Skip to content

Commit 2291d3e

Browse files
committed
Update InputForUI to ensure that the event queue will not grow
1 parent cc25550 commit 2291d3e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Assets/Tests/InputSystem/Plugins/UITests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,9 +2590,9 @@ public IEnumerator TODO_UI_CanGetLastUsedDevice()
25902590
Assert.Fail();
25912591
}
25922592

2593-
[UnityTest]
2593+
[Test]
25942594
[Category("UI")]
2595-
public IEnumerator UI_ClickDraggingMouseDoesNotAllocateGCMemory()
2595+
public void UI_ClickDraggingMouseDoesNotAllocateGCMemory()
25962596
{
25972597
var mouse = InputSystem.AddDevice<Mouse>();
25982598

@@ -2630,9 +2630,8 @@ public IEnumerator UI_ClickDraggingMouseDoesNotAllocateGCMemory()
26302630
Release(mouse.leftButton);
26312631
scene.eventSystem.InvokeUpdate();
26322632

2633-
// Waiting for a frame to ensure that everythings was updated.
2634-
// Linux seems to require it when this test is run along a "brunch" of other tests.
2635-
yield return null;
2633+
// Process all queued UI events to ensure that next events will not make the events list capacity growing
2634+
UnityEngine.InputForUI.EventProvider.NotifyUpdate();
26362635

26372636
var kProfilerRegion = "UI_ClickDraggingDoesNotAllocateGCMemory";
26382637

0 commit comments

Comments
 (0)