Loading tests/tapl/com/android/launcher3/tapl/AddToHomeScreenPrompt.java +2 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ public class AddToHomeScreenPrompt { mLauncher.clickObject( mLauncher.waitForObjectInContainer( mWidgetCell.getParent().getParent().getParent().getParent(), By.text(ADD_AUTOMATICALLY))); By.text(ADD_AUTOMATICALLY)), LauncherInstrumentation.GestureScope.OUTSIDE_WITHOUT_PILFER); mLauncher.waitUntilLauncherObjectGone(getSelector()); } } Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +13 −10 Original line number Diff line number Diff line Loading @@ -1466,19 +1466,22 @@ public final class LauncherInstrumentation { return getRealDisplaySize().x - getWindowInsets().right - 1; } void clickObject(UiObject2 object) { waitForObjectEnabled(object, "clickObject"); if (!isLauncher3() && getNavigationModel() != NavigationModel.THREE_BUTTON) { expectEvent(TestProtocol.SEQUENCE_TIS, LauncherInstrumentation.EVENT_TOUCH_DOWN_TIS); expectEvent(TestProtocol.SEQUENCE_TIS, LauncherInstrumentation.EVENT_TOUCH_UP_TIS); } object.click(); /** * Click on the ui object right away without waiting for animation. * * [UiObject2.click] would wait for all animations finished before clicking. Not waiting for * animations because in some scenarios there is a playing animations when the click is * attempted. */ void clickObject(UiObject2 uiObject, GestureScope gestureScope) { final long clickTime = SystemClock.uptimeMillis(); final Point center = uiObject.getVisibleCenter(); sendPointer(clickTime, clickTime, MotionEvent.ACTION_DOWN, center, gestureScope); sendPointer(clickTime, clickTime, MotionEvent.ACTION_UP, center, gestureScope); } void clickLauncherObject(UiObject2 object) { expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_TOUCH_DOWN); expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_TOUCH_UP); clickObject(object); clickObject(object, GestureScope.INSIDE); } void scrollToLastVisibleRow( Loading tests/tapl/com/android/launcher3/tapl/Workspace.java +1 −1 Original line number Diff line number Diff line Loading @@ -385,7 +385,7 @@ public final class Workspace extends Home { Until.hasObject(installerAlert), LauncherInstrumentation.WAIT_TIME_MS)); final UiObject2 ok = device.findObject(By.text("OK")); assertNotNull("OK button is not shown", ok); launcher.clickObject(ok); launcher.clickObject(ok, LauncherInstrumentation.GestureScope.OUTSIDE_WITHOUT_PILFER); assertTrue("Uninstall alert is not dismissed after clicking OK", device.wait( Until.gone(installerAlert), LauncherInstrumentation.WAIT_TIME_MS)); Loading Loading
tests/tapl/com/android/launcher3/tapl/AddToHomeScreenPrompt.java +2 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ public class AddToHomeScreenPrompt { mLauncher.clickObject( mLauncher.waitForObjectInContainer( mWidgetCell.getParent().getParent().getParent().getParent(), By.text(ADD_AUTOMATICALLY))); By.text(ADD_AUTOMATICALLY)), LauncherInstrumentation.GestureScope.OUTSIDE_WITHOUT_PILFER); mLauncher.waitUntilLauncherObjectGone(getSelector()); } } Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +13 −10 Original line number Diff line number Diff line Loading @@ -1466,19 +1466,22 @@ public final class LauncherInstrumentation { return getRealDisplaySize().x - getWindowInsets().right - 1; } void clickObject(UiObject2 object) { waitForObjectEnabled(object, "clickObject"); if (!isLauncher3() && getNavigationModel() != NavigationModel.THREE_BUTTON) { expectEvent(TestProtocol.SEQUENCE_TIS, LauncherInstrumentation.EVENT_TOUCH_DOWN_TIS); expectEvent(TestProtocol.SEQUENCE_TIS, LauncherInstrumentation.EVENT_TOUCH_UP_TIS); } object.click(); /** * Click on the ui object right away without waiting for animation. * * [UiObject2.click] would wait for all animations finished before clicking. Not waiting for * animations because in some scenarios there is a playing animations when the click is * attempted. */ void clickObject(UiObject2 uiObject, GestureScope gestureScope) { final long clickTime = SystemClock.uptimeMillis(); final Point center = uiObject.getVisibleCenter(); sendPointer(clickTime, clickTime, MotionEvent.ACTION_DOWN, center, gestureScope); sendPointer(clickTime, clickTime, MotionEvent.ACTION_UP, center, gestureScope); } void clickLauncherObject(UiObject2 object) { expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_TOUCH_DOWN); expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_TOUCH_UP); clickObject(object); clickObject(object, GestureScope.INSIDE); } void scrollToLastVisibleRow( Loading
tests/tapl/com/android/launcher3/tapl/Workspace.java +1 −1 Original line number Diff line number Diff line Loading @@ -385,7 +385,7 @@ public final class Workspace extends Home { Until.hasObject(installerAlert), LauncherInstrumentation.WAIT_TIME_MS)); final UiObject2 ok = device.findObject(By.text("OK")); assertNotNull("OK button is not shown", ok); launcher.clickObject(ok); launcher.clickObject(ok, LauncherInstrumentation.GestureScope.OUTSIDE_WITHOUT_PILFER); assertTrue("Uninstall alert is not dismissed after clicking OK", device.wait( Until.gone(installerAlert), LauncherInstrumentation.WAIT_TIME_MS)); Loading