@@ -225,11 +225,12 @@ public void UI_InputModuleHasDefaultActions()
225225 // click like the docs say) and also has some questionable behaviors that we opt to do different (for example, we perform
226226 // click detection *before* invoking click handlers so that clickCount and clickTime correspond to the current click instead
227227 // of to the previous click).
228+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
228229 [ UnityTest ]
229230 [ Category ( "UI" ) ]
230- #if UNITY_IOS || UNITY_TVOS
231+ #if UNITY_IOS || UNITY_TVOS
231232 [ Ignore ( "Failing on iOS https://jira.unity3d.com/browse/ISX-448" ) ]
232- #endif
233+ #endif
233234 // All pointer input goes through a single code path. Goes for Pointer-derived devices as well as for TrackedDevice input but
234235 // also any other input that can deliver point and click functionality.
235236 //
@@ -447,7 +448,7 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
447448 // Touch has no ability to point without pressing so pointer enter event is followed
448449 // right by pointer down event.
449450
450- #if UNITY_2021_2_OR_NEWER
451+ #if UNITY_2021_2_OR_NEWER
451452 // PointerMove.
452453 Assert . That ( scene . leftChildReceiver . events [ 0 + kHaveMovementEvents ] . type , Is . EqualTo ( EventType . PointerMove ) ) ;
453454 Assert . That ( scene . leftChildReceiver . events [ 0 + kHaveMovementEvents ] . pointerData . button , Is . EqualTo ( PointerEventData . InputButton . Left ) ) ;
@@ -475,7 +476,7 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
475476 Assert . That ( scene . leftChildReceiver . events [ 0 + kHaveMovementEvents ] . pointerData . pointerPressRaycast . gameObject , Is . Null ) ;
476477 Assert . That ( scene . leftChildReceiver . events [ 0 + kHaveMovementEvents ] . pointerData . pointerPressRaycast . screenPosition ,
477478 Is . EqualTo ( default ( Vector2 ) ) . Using ( Vector2EqualityComparer . Instance ) ) ;
478- #endif
479+ #endif
479480
480481 // PointerDown.
481482 Assert . That ( scene . leftChildReceiver . events [ 1 + kHaveMovementEvents ] . type , Is . EqualTo ( EventType . PointerDown ) ) ;
@@ -702,7 +703,7 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
702703 AllEvents ( "pointerCurrentRaycast.screenPosition" , secondScreenPosition ) ,
703704
704705 // PointerMove.
705- #if UNITY_2021_2_OR_NEWER
706+ #if UNITY_2021_2_OR_NEWER
706707 OneEvent ( "type" , EventType . PointerMove ) ,
707708 OneEvent ( "dragging" , false ) ,
708709 // Again, pointer movement is processed exclusively "from" the left button.
@@ -716,7 +717,7 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
716717 OneEvent ( "lastPress" , clickButton == PointerEventData . InputButton . Left ? null : scene . leftGameObject ) ,
717718 OneEvent ( "pointerPressRaycast.gameObject" , clickButton == PointerEventData . InputButton . Left ? scene . leftGameObject : null ) ,
718719 OneEvent ( "pointerPressRaycast.screenPosition" , clickButton == PointerEventData . InputButton . Left ? firstScreenPosition : Vector2 . zero ) ,
719- #endif
720+ #endif
720721
721722 // BeginDrag.
722723 OneEvent ( "type" , EventType . BeginDrag ) ,
@@ -751,9 +752,9 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
751752 Assert . That ( scene . rightChildReceiver . events , Is . Empty ) ;
752753 Assert . That ( scene . parentReceiver . events ,
753754 EventSequence (
754- #if UNITY_2021_2_OR_NEWER
755+ #if UNITY_2021_2_OR_NEWER
755756 OneEvent ( "type" , EventType . PointerMove )
756- #endif
757+ #endif
757758 )
758759 ) ;
759760
@@ -782,9 +783,9 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
782783 // children to another) but *should* have seen a move event.
783784 Assert . That ( scene . parentReceiver . events ,
784785 EventSequence (
785- #if UNITY_2021_2_OR_NEWER
786+ #if UNITY_2021_2_OR_NEWER
786787 OneEvent ( "type" , EventType . PointerMove )
787- #endif
788+ #endif
788789 )
789790 ) ;
790791
@@ -813,7 +814,7 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
813814 // press positions on the moves will be zero.
814815
815816 // PointerMove.
816- #if UNITY_2021_2_OR_NEWER
817+ #if UNITY_2021_2_OR_NEWER
817818 OneEvent ( "type" , EventType . PointerMove ) ,
818819 OneEvent ( "button" , PointerEventData . InputButton . Left ) ,
819820 OneEvent ( "pointerEnter" , scene . leftGameObject ) ,
@@ -828,7 +829,7 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
828829 OneEvent ( "dragging" , clickButton == PointerEventData . InputButton . Left ? true : false ) ,
829830 OneEvent ( "pointerPressRaycast.gameObject" , clickButton == PointerEventData . InputButton . Left ? scene . leftGameObject : null ) ,
830831 OneEvent ( "pointerPressRaycast.screenPosition" , clickButton == PointerEventData . InputButton . Left ? firstScreenPosition : Vector2 . zero ) ,
831- #endif
832+ #endif
832833
833834 // PointerExit.
834835 OneEvent ( "type" , EventType . PointerExit ) ,
@@ -889,9 +890,9 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
889890 AllEvents ( "pointerPressRaycast.screenPosition" , clickButton == PointerEventData . InputButton . Left ? firstScreenPosition : Vector2 . zero ) ,
890891
891892 OneEvent ( "type" , EventType . PointerEnter )
892- #if UNITY_2021_2_OR_NEWER
893+ #if UNITY_2021_2_OR_NEWER
893894 , OneEvent ( "type" , EventType . PointerMove )
894- #endif
895+ #endif
895896 )
896897 ) ;
897898
@@ -1103,7 +1104,10 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
11031104 }
11041105 }
11051106
1107+ #endif
1108+
11061109 // https://fogbugz.unity3d.com/f/cases/1232705/
1110+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
11071111 [ UnityTest ]
11081112 [ Category ( "UI" ) ]
11091113 public IEnumerator UI_CanReceivePointerExitsWhenChangingUIStateWithoutMovingPointer ( )
@@ -1136,14 +1140,17 @@ public IEnumerator UI_CanReceivePointerExitsWhenChangingUIStateWithoutMovingPoin
11361140 ) ;
11371141 }
11381142
1143+ #endif
1144+
1145+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
11391146 [ UnityTest ]
11401147 [ Category ( "UI" ) ]
11411148 [ TestCase ( UIPointerBehavior . SingleUnifiedPointer , ExpectedResult = - 1 ) ]
11421149 [ TestCase ( UIPointerBehavior . AllPointersAsIs , ExpectedResult = - 1 ) ]
11431150 [ TestCase ( UIPointerBehavior . SingleMouseOrPenButMultiTouchAndTrack , ExpectedResult = - 1 ) ]
1144- #if UNITY_IOS || UNITY_TVOS
1151+ #if UNITY_IOS || UNITY_TVOS
11451152 [ Ignore ( "Failing on iOS https://jira.unity3d.com/browse/ISX-448" ) ]
1146- #endif
1153+ #endif
11471154 public IEnumerator UI_CanDriveUIFromMultiplePointers ( UIPointerBehavior pointerBehavior )
11481155 {
11491156 InputSystem . RegisterLayout ( kTrackedDeviceWithButton ) ;
@@ -1354,6 +1361,9 @@ public IEnumerator UI_CanDriveUIFromMultiplePointers(UIPointerBehavior pointerBe
13541361 }
13551362 }
13561363
1364+ #endif
1365+
1366+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
13571367 [ UnityTest ]
13581368 [ Category ( "UI" ) ]
13591369 public IEnumerator UI_CanDriveUIFromMultipleTouches ( )
@@ -1558,7 +1568,10 @@ public IEnumerator UI_CanDriveUIFromMultipleTouches()
15581568 Assert . That ( scene . leftChildReceiver . events , Is . Empty ) ;
15591569 }
15601570
1571+ #endif
1572+
15611573 // https://fogbugz.unity3d.com/f/cases/1190150/
1574+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
15621575 [ UnityTest ]
15631576 [ Category ( "UI" ) ]
15641577 public IEnumerator UI_CanUseTouchSimulationWithUI ( )
@@ -1590,9 +1603,9 @@ public IEnumerator UI_CanUseTouchSimulationWithUI()
15901603 Is . EquivalentTo ( new [ ]
15911604 {
15921605 EventType . PointerEnter ,
1593- #if UNITY_2021_2_OR_NEWER
1606+ #if UNITY_2021_2_OR_NEWER
15941607 EventType . PointerMove ,
1595- #endif
1608+ #endif
15961609 EventType. PointerDown ,
15971610 EventType . InitializePotentialDrag
15981611 } ) ) ;
@@ -1613,6 +1626,8 @@ public IEnumerator UI_CanUseTouchSimulationWithUI()
16131626 }
16141627 }
16151628
1629+ #endif
1630+
16161631 #if UNITY_IOS || UNITY_TVOS
16171632 [ Ignore ( "Failing on iOS https://jira.unity3d.com/browse/ISX-448" ) ]
16181633 #endif
@@ -1796,6 +1811,7 @@ public IEnumerator UI_CanDriveUIFromMultipleTrackedDevices()
17961811 // from non-pointer devices, we need to decide what to do. What the UI input module does is try to find a pointer (classic
17971812 // or tracked) into which to route the input. Only if it can't find an existing pointer to route the input into will it
17981813 // resort to turning the non-pointer device into a (likely non-functional) pointer.
1814+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
17991815 [ UnityTest ]
18001816 [ Category ( "UI" ) ]
18011817 public IEnumerator UI_CanTriggerPointerClicksFromNonPointerDevices ( )
@@ -1834,7 +1850,10 @@ public IEnumerator UI_CanTriggerPointerClicksFromNonPointerDevices()
18341850 . Matches ( ( UICallbackReceiver . Event eventRecord ) => eventRecord . pointerData . clickCount == 0 ) ) ;
18351851 }
18361852
1853+ #endif
1854+
18371855 // https://fogbugz.unity3d.com/f/cases/1317239/
1856+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
18381857 [ UnityTest ]
18391858 [ Category ( "UI" ) ]
18401859 public IEnumerator UI_CanDetectClicks_WithSuccessiveClicksReflectedInClickCount ( )
@@ -2008,11 +2027,14 @@ public IEnumerator UI_CanDetectClicks_WithSuccessiveClicksReflectedInClickCount(
20082027 ) ;
20092028 }
20102029
2030+ #endif
2031+
20112032 // The UI input module needs to return true from IsPointerOverGameObject() for touches
20122033 // that have ended in the current frame. I.e. even though the touch is already concluded
20132034 // at the InputDevice level, the UI module needs to maintain state for one more frame.
20142035 //
20152036 // https://fogbugz.unity3d.com/f/cases/1347048/
2037+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
20162038 [ UnityTest ]
20172039 [ Category ( "UI" ) ]
20182040 public IEnumerator UI_TouchPointersAreKeptForOneFrameAfterRelease ( )
@@ -2048,6 +2070,8 @@ public IEnumerator UI_TouchPointersAreKeptForOneFrameAfterRelease()
20482070 Assert . That ( EventSystem . current . IsPointerOverGameObject ( ) , Is . False ) ;
20492071 }
20502072
2073+ #endif
2074+
20512075 [ UnityTest ]
20522076 [ Category ( "UI" ) ]
20532077 public IEnumerator UI_CallingIsPointerOverGameObject_FromActionCallback_ResultsInWarning ( )
@@ -2274,6 +2298,7 @@ public IEnumerator UI_ClickDraggingMouseDoesNotAllocateGCMemory()
22742298 } , Is . Not . AllocatingGCMemory ( ) ) ;
22752299 }
22762300
2301+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
22772302 [ UnityTest ]
22782303 [ Category ( "UI" ) ]
22792304 // Check that two players can have separate UI, and that both selections will stay active when
@@ -2362,6 +2387,8 @@ public IEnumerator UI_CanOperateMultiplayerUIGloballyUsingMouse()
23622387 Assert . That ( players [ 1 ] . eventSystem . currentSelectedGameObject , Is . SameAs ( players [ 1 ] . rightGameObject ) ) ;
23632388 }
23642389
2390+ #endif
2391+
23652392 [ UnityTest ]
23662393 [ Category ( "UI" ) ]
23672394 // Check that two players can have separate UI and control it using separate gamepads, using
@@ -2667,6 +2694,7 @@ public void UI_CanReassignUIActions()
26672694 Assert . That ( uiModule . point ? . action , Is . Null ) ;
26682695 }
26692696
2697+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
26702698 [ UnityTest ]
26712699 [ Category ( "UI" ) ]
26722700 public IEnumerator UI_CanChangeControlsOnActions ( )
@@ -2710,6 +2738,8 @@ public IEnumerator UI_CanChangeControlsOnActions()
27102738 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . device == mouse ) ) ;
27112739 }
27122740
2741+ #endif
2742+
27132743 private class InputSystemUIInputModuleTestScene_Setup : IPrebuildSetup , IPostBuildCleanup
27142744 {
27152745 public void Setup ( )
@@ -2927,6 +2957,7 @@ public void UI_MovingAndClickingMouseDoesNotAllocateGCMemory()
29272957 }
29282958
29292959 // https://forum.unity.com/threads/feature-request-option-to-disable-deselect-in-ui-input-module.761531
2960+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
29302961 [ UnityTest ]
29312962 [ Category ( "UI" ) ]
29322963 public IEnumerator UI_CanPreventAutomaticDeselectionOfGameObjects ( )
@@ -2987,6 +3018,9 @@ public IEnumerator UI_CanPreventAutomaticDeselectionOfGameObjects()
29873018 Assert . That ( scene . eventSystem . currentSelectedGameObject , Is . SameAs ( scene . leftGameObject ) ) ;
29883019 }
29893020
3021+ #endif
3022+
3023+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
29903024 [ UnityTest ]
29913025 [ Category ( "UI" ) ]
29923026 public IEnumerator UI_WhenBindingsAreReResolved_PointerStatesAreKeptInSync ( )
@@ -3037,6 +3071,8 @@ public IEnumerator UI_WhenBindingsAreReResolved_PointerStatesAreKeptInSync()
30373071 Assert . That ( EventSystem . current . IsPointerOverGameObject ( ) , Is . True ) ;
30383072 }
30393073
3074+ #endif
3075+
30403076 ////REVIEW: While `deselectOnBackgroundClick` does solve the problem of breaking keyboard and gamepad navigation, the question
30413077 //// IMO is whether navigation should even be affected that way by not having a current selection. Seems to me that the
30423078 //// the system should remember the last selected object and start up navigation from there when nothing is selected.
@@ -3274,7 +3310,7 @@ public void UI_CanDriveVirtualMouseCursorFromGamepad()
32743310 // to our manifest without breaking test runs with previous versions of Unity. However, in 2021.2, all the UITK functionality
32753311 // has moved into the com.unity.modules.uielements module which is also available in previous versions of Unity. This way we
32763312 // can have a reference to UITK that doesn't break things in previous versions of Unity.
3277- #if UNITY_2021_2_OR_NEWER
3313+ #if UNITY_2021_2_OR_NEWER && ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
32783314 [ UnityTest ]
32793315 [ Category ( "UI" ) ]
32803316 #if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS
@@ -3375,6 +3411,7 @@ public void Setup()
33753411 }
33763412 #endif
33773413
3414+ #if ! TEMP_DISABLE_UI_TESTS_ON_TRUNK
33783415 [ UnityTest ]
33793416 [ Category ( "Focus" ) ]
33803417 public IEnumerator UI_WhenAppLosesAndRegainsFocus_WhileUIButtonIsPressed_UIButtonIsNotClicked ( )
@@ -3415,9 +3452,9 @@ public IEnumerator UI_WhenAppLosesAndRegainsFocus_WhileUIButtonIsPressed_UIButto
34153452 Assert . That ( scene . leftChildReceiver . events ,
34163453 EventSequence (
34173454 OneEvent ( "type" , EventType . PointerEnter ) ,
3418- #if UNITY_2021_2_OR_NEWER
3455+ #if UNITY_2021_2_OR_NEWER
34193456 OneEvent ( "type" , EventType . PointerMove ) ,
3420- #endif
3457+ #endif
34213458 OneEvent( "type" , EventType . PointerDown ) ,
34223459 OneEvent ( "type" , EventType . InitializePotentialDrag )
34233460 )
@@ -3447,6 +3484,8 @@ public IEnumerator UI_WhenAppLosesAndRegainsFocus_WhileUIButtonIsPressed_UIButto
34473484 Assert . That ( clicked , Is . False ) ;
34483485 }
34493486
3487+ #endif
3488+
34503489 public class MyButton : UnityEngine . UI . Button
34513490 {
34523491 public bool receivedPointerDown ;
0 commit comments