From dcc8d589e63fccc321238f96bcd9701af65451ed Mon Sep 17 00:00:00 2001 From: Morgan Hoarau Date: Thu, 5 Mar 2026 17:02:32 +0000 Subject: [PATCH 1/4] Refactor UITK UI input tests and re-enable test on CI Split monolithic UITests method into multiple focused UnityTests (mouse click, mouse scroll, gamepad submit, multi-touch pointer ownership, and multi-touch visual active-state). Added stronger assertions (including pointerId ownership checks), and clearer assertion messages. --- Assets/Tests/InputSystem/Plugins/UITests.cs | 257 +++++++++++++++----- 1 file changed, 198 insertions(+), 59 deletions(-) diff --git a/Assets/Tests/InputSystem/Plugins/UITests.cs b/Assets/Tests/InputSystem/Plugins/UITests.cs index 15f17299ea..ab585e8fd1 100644 --- a/Assets/Tests/InputSystem/Plugins/UITests.cs +++ b/Assets/Tests/InputSystem/Plugins/UITests.cs @@ -3922,22 +3922,16 @@ public void UI_CanDriveVirtualMouseCursorFromGamepad() // can have a reference to UITK that doesn't break things in previous versions of Unity. [UnityTest] [Category("UI")] - [TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1)] - [TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1)] - [TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = 1)] -#if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS - [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] -#endif -#if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX - [Ignore("Disabled to make test suite pass on Linux")] -#endif +// #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS +// [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] +// #endif +// #if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX +// [Ignore("Disabled to make test suite pass on Linux")] +// #endif [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] - public IEnumerator UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule(UIPointerBehavior pointerBehavior) + public IEnumerator UI_UIToolkitInputModule_MouseClick_CapturesAndClicksButton() { var mouse = InputSystem.AddDevice(); - var gamepad = InputSystem.AddDevice(); - var touchscreen = InputSystem.AddDevice(); - var scene = SceneManager.LoadScene("UITKTestScene", new LoadSceneParameters(LoadSceneMode.Additive)); yield return null; Assert.That(scene.isLoaded, Is.True, "UITKTestScene did not load as expected"); @@ -3946,88 +3940,167 @@ public IEnumerator UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule { var objects = scene.GetRootGameObjects(); var uiModule = objects.First(x => x.name == "EventSystem").GetComponent(); - InputSystem.settings.backgroundBehavior = InputSettings.BackgroundBehavior.IgnoreFocus; var uiDocument = objects.First(x => x.name == "UIDocument").GetComponent(); - var uiRoot = uiDocument.rootVisualElement; - var uiButton = uiRoot.Query("Button").First(); - var scrollView = uiRoot.Query("ScrollView").First(); - - uiModule.pointerBehavior = pointerBehavior; + var uiButton = uiDocument.rootVisualElement.Query("Button").First(); var clickReceived = false; uiButton.clicked += () => clickReceived = true; - // NOTE: We do *NOT* do the following as the gamepad submit action will *not* trigger a ClickEvent. - //uiButton.RegisterCallback(_ => clickReceived = true); yield return null; var buttonCenter = new Vector2(uiButton.worldBound.center.x, Screen.height - uiButton.worldBound.center.y); - var buttonOutside = new Vector2(uiButton.worldBound.max.x + 10, Screen.height - uiButton.worldBound.center.y); - var scrollViewCenter = new Vector2(scrollView.worldBound.center.x, Screen.height - scrollView.worldBound.center.y); - Set(mouse.position, buttonCenter, queueEventOnly: true); Press(mouse.leftButton, queueEventOnly: true); - - ////TODO: look at BaseInput and whether we need to override it in order for IME to go through our codepaths - ////TODO: look into or document raycasting aspect (GraphicRaycaster) when using UITK (disable raycaster?) - ////TODO: fix scroll wheel bindings on virtual cursor sample - yield return null; - Assert.That(uiButton.HasMouseCapture(), Is.True, "Expected uiButton to have mouse capture"); Release(mouse.leftButton, queueEventOnly: true); - yield return null; - Assert.That(uiButton.HasMouseCapture(), Is.False, "Expected uiButton to no longer have mouse capture"); - Assert.That(clickReceived, Is.True); + Assert.That(clickReceived, Is.True, "Expected mouse click callback on UITK button"); + } + finally + { + SceneManager.UnloadSceneAsync(scene); + } + + yield return null; + } + + [UnityTest] + [Category("UI")] +// #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS +// [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] +// #endif +// #if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX +// [Ignore("Disabled to make test suite pass on Linux")] +// #endif + [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] + public IEnumerator UI_UIToolkitInputModule_MouseScroll_MovesScrollView() + { + var mouse = InputSystem.AddDevice(); + var scene = SceneManager.LoadScene("UITKTestScene", new LoadSceneParameters(LoadSceneMode.Additive)); + yield return null; + Assert.That(scene.isLoaded, Is.True, "UITKTestScene did not load as expected"); - // Put mouse in upper right corner and scroll down. + try + { + var objects = scene.GetRootGameObjects(); + var uiModule = objects.First(x => x.name == "EventSystem").GetComponent(); + var uiDocument = objects.First(x => x.name == "UIDocument").GetComponent(); + var scrollView = uiDocument.rootVisualElement.Query("ScrollView").First(); + + yield return null; + + var scrollViewCenter = new Vector2(scrollView.worldBound.center.x, Screen.height - scrollView.worldBound.center.y); Assert.That(scrollView.verticalScroller.value, Is.Zero, "Expected verticalScroller to be all the way up"); Set(mouse.position, scrollViewCenter, queueEventOnly: true); yield return null; Set(mouse.scroll, new Vector2(0, -100), queueEventOnly: true); yield return null; - - ////FIXME: as of a time of writing, this line is broken on trunk due to the bug in UITK - // The bug is https://fogbugz.unity3d.com/f/cases/1323488/ - // just adding a define as a safeguard measure to reenable it when trunk goes to next version cycle Assert.That(scrollView.verticalScroller.value, Is.GreaterThan(0)); + } + finally + { + SceneManager.UnloadSceneAsync(scene); + } + + yield return null; + } - // Try a button press with the gamepad. - // NOTE: The current version of UITK does not focus the button automatically. Fix for that is in the pipe. - // For now focus the button manually. + [UnityTest] + [Category("UI")] +// #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS +// [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] +// #endif +// #if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX +// [Ignore("Disabled to make test suite pass on Linux")] +// #endif + [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] + public IEnumerator UI_UIToolkitInputModule_GamepadSubmit_ClicksFocusedButton() + { + var gamepad = InputSystem.AddDevice(); + var scene = SceneManager.LoadScene("UITKTestScene", new LoadSceneParameters(LoadSceneMode.Additive)); + yield return null; + Assert.That(scene.isLoaded, Is.True, "UITKTestScene did not load as expected"); + + try + { + var objects = scene.GetRootGameObjects(); + var uiModule = objects.First(x => x.name == "EventSystem").GetComponent(); + var uiDocument = objects.First(x => x.name == "UIDocument").GetComponent(); + var uiButton = uiDocument.rootVisualElement.Query("Button").First(); + + yield return null; + + var clickReceived = false; + uiButton.clicked += () => clickReceived = true; uiButton.Focus(); - clickReceived = false; + PressAndRelease(gamepad.buttonSouth, queueEventOnly: true); yield return null; + Assert.That(clickReceived, Is.True, "Expected gamepad submit to click focused UITK button"); + } + finally + { + SceneManager.UnloadSceneAsync(scene); + } - Assert.That(clickReceived, Is.True, "Expected to have received click"); + yield return null; + } - ////TODO: tracked device support (not yet supported by UITK) + [UnityTest] + [Category("UI")] + [TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1)] + [TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1)] + [TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = 1)] +// #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS +// [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] +// #endif +// #if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX +// [Ignore("Disabled to make test suite pass on Linux")] +// #endif + [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] + public IEnumerator UI_UIToolkitInputModule_MultiTouchPointerOwnership(UIPointerBehavior pointerBehavior) + { + var touchscreen = InputSystem.AddDevice(); + var scene = SceneManager.LoadScene("UITKTestScene", new LoadSceneParameters(LoadSceneMode.Additive)); + yield return null; + Assert.That(scene.isLoaded, Is.True, "UITKTestScene did not load as expected"); - static bool IsActive(VisualElement ve) - { - return ve.Query().Active().ToList().Contains(ve); - } + try + { + var objects = scene.GetRootGameObjects(); + var uiModule = objects.First(x => x.name == "EventSystem").GetComponent(); + var uiDocument = objects.First(x => x.name == "UIDocument").GetComponent(); + var uiButton = uiDocument.rootVisualElement.Query("Button").First(); - // Move the mouse away from the button to check that touch inputs are also able to activate it. - Set(mouse.position, buttonOutside, queueEventOnly: true); + uiModule.pointerBehavior = pointerBehavior; yield return null; - InputSystem.RemoveDevice(mouse); + + var buttonCenter = new Vector2(uiButton.worldBound.center.x, Screen.height - uiButton.worldBound.center.y); + var buttonOutside = new Vector2(uiButton.worldBound.max.x + 10, Screen.height - uiButton.worldBound.center.y); var uiButtonDownCount = 0; var uiButtonUpCount = 0; - uiButton.RegisterCallback(e => uiButtonDownCount++, TrickleDown.TrickleDown); - uiButton.RegisterCallback(e => uiButtonUpCount++, TrickleDown.TrickleDown); + var uiButtonDownPointerIds = new List(); + var uiButtonUpPointerIds = new List(); + uiButton.RegisterCallback(eventData => + { + uiButtonDownCount++; + uiButtonDownPointerIds.Add(eventData.pointerId); + }, TrickleDown.TrickleDown); + uiButton.RegisterCallback(eventData => + { + uiButtonUpCount++; + uiButtonUpPointerIds.Add(eventData.pointerId); + }, TrickleDown.TrickleDown); - // Case 1369081: Make sure button doesn't get "stuck" in an active state when multiple fingers are used. BeginTouch(1, buttonCenter, screen: touchscreen); yield return null; Assert.That(uiButtonDownCount, Is.EqualTo(1), "Expected uiButtonDownCount to be 1"); Assert.That(uiButtonUpCount, Is.EqualTo(0), "Expected uiButtonUpCount to be 0"); - Assert.That(IsActive(uiButton), Is.True, "Expected uiButton to be active"); + Assert.That(uiButtonDownPointerIds, Has.Count.EqualTo(1), "Expected one PointerDown pointerId"); BeginTouch(2, buttonOutside, screen: touchscreen); yield return null; @@ -4038,19 +4111,81 @@ static bool IsActive(VisualElement ve) if (pointerBehavior == UIPointerBehavior.SingleUnifiedPointer) { Assert.That(uiButtonUpCount, Is.EqualTo(1), "Expected uiButtonUpCount to be 1"); - Assert.That(IsActive(uiButton), Is.False, "Expected uiButton to no longer be active"); + Assert.That(uiButtonUpPointerIds, Has.Count.EqualTo(1), "Expected one PointerUp pointerId"); } else { Assert.That(uiButtonUpCount, Is.EqualTo(0), "Expected uiButtonUpCount to be 0"); - Assert.That(IsActive(uiButton), Is.True, "Expected uiButton to be active"); + Assert.That(uiButtonUpPointerIds, Is.Empty, "Expected no PointerUp pointerId from outside touch"); } EndTouch(1, buttonCenter, screen: touchscreen); yield return null; Assert.That(uiButtonDownCount, Is.EqualTo(1), "Expected uiButtonDownCount to be 1"); Assert.That(uiButtonUpCount, Is.EqualTo(1), "Expected uiButtonUpCount to be 1"); - Assert.That(IsActive(uiButton), Is.False, "Expected uiButton to no longer be active"); + Assert.That(uiButtonUpPointerIds, Has.Count.EqualTo(1), "Expected one PointerUp pointerId after releasing touch #1"); + Assert.That(uiButtonUpPointerIds[0], Is.EqualTo(uiButtonDownPointerIds[0]), + "Expected PointerUp ownership to match the pointer that pressed the button"); + Assert.That(IsActiveVisualElement(uiButton), Is.False, "Expected uiButton to no longer be active"); + } + finally + { + SceneManager.UnloadSceneAsync(scene); + } + + yield return null; + } + + [UnityTest] + [Category("UI")] + [TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1)] + [TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1)] + [TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = 1)] + [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] + public IEnumerator UI_UIToolkitInputModule_MultiTouchVisualActiveState_FollowsPointerBehavior(UIPointerBehavior pointerBehavior) + { + var touchscreen = InputSystem.AddDevice(); + var scene = SceneManager.LoadScene("UITKTestScene", new LoadSceneParameters(LoadSceneMode.Additive)); + yield return null; + Assert.That(scene.isLoaded, Is.True, "UITKTestScene did not load as expected"); + + try + { + var objects = scene.GetRootGameObjects(); + var uiModule = objects.First(x => x.name == "EventSystem").GetComponent(); + var uiDocument = objects.First(x => x.name == "UIDocument").GetComponent(); + var uiRoot = uiDocument.rootVisualElement; + var uiButton = uiRoot.Query("Button").First(); + + uiModule.pointerBehavior = pointerBehavior; + + yield return null; + + var buttonCenter = new Vector2(uiButton.worldBound.center.x, Screen.height - uiButton.worldBound.center.y); + var buttonOutside = new Vector2(uiButton.worldBound.max.x + 10, Screen.height - uiButton.worldBound.center.y); + + // Finger #1 presses and holds on the button. + BeginTouch(1, buttonCenter, screen: touchscreen); + yield return null; + Assert.That(IsActiveVisualElement(uiButton), Is.True, "Expected uiButton to be active while touch #1 is still pressed."); + + // Finger #2 taps outside of the button while finger #1 is still held. + BeginTouch(2, buttonOutside, screen: touchscreen); + yield return null; + EndTouch(2, buttonOutside, screen: touchscreen); + yield return null; + + // Desired contract: + // - SingleUnifiedPointer: touch #2 can replace current pointer and clear active state. + // - Non-unified behaviors: touch #1 is still pressed and should keep the button visually active. + if (pointerBehavior == UIPointerBehavior.SingleUnifiedPointer) + Assert.That(IsActiveVisualElement(uiButton), Is.False, "Expected uiButton to no longer be active in SingleUnifiedPointer mode."); + else + Assert.That(IsActiveVisualElement(uiButton), Is.True, "Expected uiButton to remain active while touch #1 is still pressed."); + + EndTouch(1, buttonCenter, screen: touchscreen); + yield return null; + Assert.That(IsActiveVisualElement(uiButton), Is.False, "Expected uiButton to no longer be active after touch #1 is released."); InputSystem.RemoveDevice(touchscreen); } @@ -4059,10 +4194,14 @@ static bool IsActive(VisualElement ve) SceneManager.UnloadSceneAsync(scene); } - // Wait for unload to complete. yield return null; } + private static bool IsActiveVisualElement(VisualElement visualElement) + { + return visualElement.Query().Active().ToList().Contains(visualElement); + } + private class UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup : IPrebuildSetup { public void Setup() From 69236eb57641e078511feff2940a045e03e04414 Mon Sep 17 00:00:00 2001 From: Morgan Hoarau Date: Fri, 6 Mar 2026 11:46:19 +0000 Subject: [PATCH 2/4] Conditional skips and device cleanup in UITests Skip Android/iOS on several 2 failing UI tests to address CI failures on Unity 2022.3. + Clean up created input devices --- Assets/Tests/InputSystem/Plugins/UITests.cs | 45 +++++++++------------ 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/Assets/Tests/InputSystem/Plugins/UITests.cs b/Assets/Tests/InputSystem/Plugins/UITests.cs index ab585e8fd1..470291ee20 100644 --- a/Assets/Tests/InputSystem/Plugins/UITests.cs +++ b/Assets/Tests/InputSystem/Plugins/UITests.cs @@ -3922,12 +3922,9 @@ public void UI_CanDriveVirtualMouseCursorFromGamepad() // can have a reference to UITK that doesn't break things in previous versions of Unity. [UnityTest] [Category("UI")] -// #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS -// [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] -// #endif -// #if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX -// [Ignore("Disabled to make test suite pass on Linux")] -// #endif +#if UNITY_2022_3_OR_LOWER && (UNITY_ANDROID || UNITY_IOS) // || UNITY_TVOS + [Ignore("Issue with mouse support on Android and iOS for 2022.3.")] +#endif [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] public IEnumerator UI_UIToolkitInputModule_MouseClick_CapturesAndClicksButton() { @@ -3961,6 +3958,8 @@ public IEnumerator UI_UIToolkitInputModule_MouseClick_CapturesAndClicksButton() } finally { + if (mouse.added) + InputSystem.RemoveDevice(mouse); SceneManager.UnloadSceneAsync(scene); } @@ -3969,12 +3968,6 @@ public IEnumerator UI_UIToolkitInputModule_MouseClick_CapturesAndClicksButton() [UnityTest] [Category("UI")] -// #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS -// [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] -// #endif -// #if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX -// [Ignore("Disabled to make test suite pass on Linux")] -// #endif [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] public IEnumerator UI_UIToolkitInputModule_MouseScroll_MovesScrollView() { @@ -4002,6 +3995,8 @@ public IEnumerator UI_UIToolkitInputModule_MouseScroll_MovesScrollView() } finally { + if (mouse.added) + InputSystem.RemoveDevice(mouse); SceneManager.UnloadSceneAsync(scene); } @@ -4010,12 +4005,6 @@ public IEnumerator UI_UIToolkitInputModule_MouseScroll_MovesScrollView() [UnityTest] [Category("UI")] -// #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS -// [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] -// #endif -// #if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX -// [Ignore("Disabled to make test suite pass on Linux")] -// #endif [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] public IEnumerator UI_UIToolkitInputModule_GamepadSubmit_ClicksFocusedButton() { @@ -4043,6 +4032,8 @@ public IEnumerator UI_UIToolkitInputModule_GamepadSubmit_ClicksFocusedButton() } finally { + if (gamepad.added) + InputSystem.RemoveDevice(gamepad); SceneManager.UnloadSceneAsync(scene); } @@ -4054,11 +4045,11 @@ public IEnumerator UI_UIToolkitInputModule_GamepadSubmit_ClicksFocusedButton() [TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1)] [TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1)] [TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = 1)] -// #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS -// [Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")] -// #endif -// #if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX -// [Ignore("Disabled to make test suite pass on Linux")] +#if UNITY_2022_3_OR_LOWER && (UNITY_ANDROID || UNITY_IOS) + [Ignore("Fails on CI for 2022.3 on Android and iOS.")] +#endif +// #if UNITY_EDITOR_LINUX +// [Ignore("Fails on CI for Editor Ubuntu")] // #endif [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] public IEnumerator UI_UIToolkitInputModule_MultiTouchPointerOwnership(UIPointerBehavior pointerBehavior) @@ -4130,6 +4121,8 @@ public IEnumerator UI_UIToolkitInputModule_MultiTouchPointerOwnership(UIPointerB } finally { + if (touchscreen.added) + InputSystem.RemoveDevice(touchscreen); SceneManager.UnloadSceneAsync(scene); } @@ -4186,11 +4179,11 @@ public IEnumerator UI_UIToolkitInputModule_MultiTouchVisualActiveState_FollowsPo EndTouch(1, buttonCenter, screen: touchscreen); yield return null; Assert.That(IsActiveVisualElement(uiButton), Is.False, "Expected uiButton to no longer be active after touch #1 is released."); - - InputSystem.RemoveDevice(touchscreen); } finally { + if (touchscreen.added) + InputSystem.RemoveDevice(touchscreen); SceneManager.UnloadSceneAsync(scene); } @@ -4648,7 +4641,7 @@ public IEnumerator UI_DisplayIndexMatchesDisplayMultiplePointers() } #endif - #endregion +#endregion public class MyButton : UnityEngine.UI.Button { From db403bce282d06d8e67cf9f2f036e7c9fb4f2c00 Mon Sep 17 00:00:00 2001 From: Morgan Hoarau Date: Fri, 6 Mar 2026 12:27:40 +0000 Subject: [PATCH 3/4] Update UITests.cs --- Assets/Tests/InputSystem/Plugins/UITests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Tests/InputSystem/Plugins/UITests.cs b/Assets/Tests/InputSystem/Plugins/UITests.cs index 470291ee20..c09429e721 100644 --- a/Assets/Tests/InputSystem/Plugins/UITests.cs +++ b/Assets/Tests/InputSystem/Plugins/UITests.cs @@ -3922,7 +3922,7 @@ public void UI_CanDriveVirtualMouseCursorFromGamepad() // can have a reference to UITK that doesn't break things in previous versions of Unity. [UnityTest] [Category("UI")] -#if UNITY_2022_3_OR_LOWER && (UNITY_ANDROID || UNITY_IOS) // || UNITY_TVOS +#if UNITY_2022_3 && (UNITY_ANDROID || UNITY_IOS) // || UNITY_TVOS [Ignore("Issue with mouse support on Android and iOS for 2022.3.")] #endif [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] @@ -4045,7 +4045,7 @@ public IEnumerator UI_UIToolkitInputModule_GamepadSubmit_ClicksFocusedButton() [TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1)] [TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1)] [TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = 1)] -#if UNITY_2022_3_OR_LOWER && (UNITY_ANDROID || UNITY_IOS) +#if UNITY_2022_3 && (UNITY_ANDROID || UNITY_IOS) [Ignore("Fails on CI for 2022.3 on Android and iOS.")] #endif // #if UNITY_EDITOR_LINUX From ea30c6f335d7347305151056a7da0d9e8f82bbe7 Mon Sep 17 00:00:00 2001 From: Morgan Hoarau Date: Fri, 6 Mar 2026 18:00:53 +0000 Subject: [PATCH 4/4] Skip another tests failing on 2022.3 mobile --- Assets/Tests/InputSystem/Plugins/UITests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Tests/InputSystem/Plugins/UITests.cs b/Assets/Tests/InputSystem/Plugins/UITests.cs index c09429e721..f9473cae67 100644 --- a/Assets/Tests/InputSystem/Plugins/UITests.cs +++ b/Assets/Tests/InputSystem/Plugins/UITests.cs @@ -3922,7 +3922,7 @@ public void UI_CanDriveVirtualMouseCursorFromGamepad() // can have a reference to UITK that doesn't break things in previous versions of Unity. [UnityTest] [Category("UI")] -#if UNITY_2022_3 && (UNITY_ANDROID || UNITY_IOS) // || UNITY_TVOS +#if UNITY_2022_3 && (UNITY_ANDROID || UNITY_IOS) [Ignore("Issue with mouse support on Android and iOS for 2022.3.")] #endif [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] @@ -4048,9 +4048,6 @@ public IEnumerator UI_UIToolkitInputModule_GamepadSubmit_ClicksFocusedButton() #if UNITY_2022_3 && (UNITY_ANDROID || UNITY_IOS) [Ignore("Fails on CI for 2022.3 on Android and iOS.")] #endif -// #if UNITY_EDITOR_LINUX -// [Ignore("Fails on CI for Editor Ubuntu")] -// #endif [PrebuildSetup(typeof(UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModule_Setup))] public IEnumerator UI_UIToolkitInputModule_MultiTouchPointerOwnership(UIPointerBehavior pointerBehavior) { @@ -4131,6 +4128,9 @@ public IEnumerator UI_UIToolkitInputModule_MultiTouchPointerOwnership(UIPointerB [UnityTest] [Category("UI")] +#if UNITY_2022_3 && (UNITY_ANDROID || UNITY_IOS) + [Ignore("Issue with mouse support on Android and iOS for 2022.3.")] +#endif [TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1)] [TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1)] [TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = 1)]