Skip to content

Commit c022f7f

Browse files
benoitalainbmalrat
andauthored
FIX: ISX-1183 fixed and reenabled UITests for InputSystemUIInputModule. (#1974)
* ISX-1183: fixed and reenabled UITests for InputSystemUIInputModule. * Attempted to stabilize UI_CanOperateUIToolkitInterface test. * Don't run the UIToolkit tests on 2021 * Reverted unneeded changes to UITests. --------- Co-authored-by: bmalrat <47957918+bmalrat@users.noreply.github.com>
1 parent e72d158 commit c022f7f

3 files changed

Lines changed: 7 additions & 20 deletions

File tree

Assets/Tests/InputSystem/Assets/UITKTestSceneDocument.uxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
22
<ui:VisualElement style="width: 640px; height: 480px;">
33
<ui:ScrollView name="ScrollView" style="flex-grow: 1; width: 50%; height: 100px; left: 50%; top: 0; flex-direction: column; flex-basis: auto; position: absolute;">
4-
<ui:TextField picking-mode="Ignore" value="filler text" text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&#10;" multiline="false" readonly="true" style="font-size: 50px; white-space: normal;" />
4+
<ui:TextField picking-mode="Ignore" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&#10;" multiline="true" readonly="true" style="font-size: 50px; white-space: normal;" />
55
</ui:ScrollView>
66
<ui:Button text="Button" display-tooltip-when-elided="true" name="Button" focusable="true" style="justify-content: flex-start; height: 100%; width: 50%; align-items: stretch; left: auto; flex-grow: 1;" />
77
</ui:VisualElement>

Assets/Tests/InputSystem/Plugins/UITests.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public Quaternion RotateFromTo(Vector3 position, GameObject from, GameObject to)
117117
public override void Setup()
118118
{
119119
base.Setup();
120+
Screen.SetResolution(640, 480, FullScreenMode.Windowed);
120121
}
121122

122123
private static TestObjects CreateUIScene()
@@ -3567,22 +3568,13 @@ public void UI_CanDriveVirtualMouseCursorFromGamepad()
35673568
// to our manifest without breaking test runs with previous versions of Unity. However, in 2021.2, all the UITK functionality
35683569
// has moved into the com.unity.modules.uielements module which is also available in previous versions of Unity. This way we
35693570
// can have a reference to UITK that doesn't break things in previous versions of Unity.
3570-
#if UNITY_2021_2_OR_NEWER
3571+
#if UNITY_2022_3_OR_NEWER
35713572
[UnityTest]
35723573
[Category("UI")]
3573-
[TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1
3574-
#if TEMP_DISABLE_UITOOLKIT_TEST && (UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN)
3575-
, Ignore = "Currently fails on MacOS, MacOS standalone, MacOS standalone IL2CPP player on Unity version 2022.2 CI"
3576-
#endif
3577-
)]
3578-
[TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1
3579-
#if TEMP_DISABLE_UITOOLKIT_TEST && (UNITY_STANDALONE_OSX)
3580-
// temporarily disable this test case on OSX player for 2021.2. It only intermittently works and I don't know why!
3581-
, Ignore = "Currently fails on OSX IL2CPP player on Unity version 2021.2"
3582-
#endif
3583-
)]
3574+
[TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1)]
3575+
[TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1)]
35843576
[TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = 1)]
3585-
#if (UNITY_ANDROID || UNITY_IOS || UNITY_TVOS) || (TEMP_DISABLE_UITOOLKIT_TEST && (UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN))
3577+
#if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS
35863578
[Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")]
35873579
#endif
35883580
#if UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX
@@ -3684,7 +3676,7 @@ static bool IsActive(VisualElement ve)
36843676
// Case 1369081: Make sure button doesn't get "stuck" in an active state when multiple fingers are used.
36853677
BeginTouch(1, buttonCenter, screen: touchscreen);
36863678
yield return null;
3687-
Assert.That(uiButtonDownCount, Is.EqualTo(1), "Expected uiButtonDownCount to be 0");
3679+
Assert.That(uiButtonDownCount, Is.EqualTo(1), "Expected uiButtonDownCount to be 1");
36883680
Assert.That(uiButtonUpCount, Is.EqualTo(0), "Expected uiButtonUpCount to be 0");
36893681
Assert.That(IsActive(uiButton), Is.True, "Expected uiButton to be active");
36903682

Assets/Tests/InputSystem/Unity.InputSystem.Tests.asmdef

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
"expression": "1.0",
3232
"define": "HAVE_DOCTOOLS_INSTALLED"
3333
},
34-
{
35-
"name": "Unity",
36-
"expression": "2021.1",
37-
"define": "TEMP_DISABLE_UITOOLKIT_TEST"
38-
},
3934
{
4035
"name": "Unity",
4136
"expression": "2022.1",

0 commit comments

Comments
 (0)