Loading src/com/android/launcher3/Launcher.java +0 −3 Original line number Diff line number Diff line Loading @@ -923,8 +923,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, } }); } TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Activity.onStop"); } @Override Loading @@ -938,7 +936,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, mAppWidgetHost.setListenIfResumed(true); TraceHelper.INSTANCE.endSection(traceToken); TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Activity.onStart"); } private void handleDeferredResume() { Loading tests/tapl/com/android/launcher3/tapl/Background.java +0 −18 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { } protected void goToOverviewUnchecked() { final boolean launcherWasVisible = mLauncher.isLauncherVisible(); switch (mLauncher.getNavigationModel()) { case ZERO_BUTTON: { final int centerX = mLauncher.getDevice().getDisplayWidth() / 2; Loading Loading @@ -138,11 +137,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { break; } expectSwitchToOverviewEvents(); if (!launcherWasVisible) { mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START_ACTIVITY); } } private void expectSwitchToOverviewEvents() { Loading Loading @@ -192,11 +186,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { } final boolean isZeroButton = mLauncher.getNavigationModel() == LauncherInstrumentation.NavigationModel.ZERO_BUTTON; if (!launcherWasVisible) { mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START_ACTIVITY); } mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState, launcherWasVisible && isZeroButton ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE Loading @@ -208,11 +197,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { // Double press the recents button. UiObject2 recentsButton = mLauncher.waitForSystemUiObject("recent_apps"); mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, SQUARE_BUTTON_EVENT); if (!launcherWasVisible) { mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START_ACTIVITY); } mLauncher.runToState(() -> recentsButton.click(), OVERVIEW_STATE_ORDINAL); mLauncher.getOverview(); mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, SQUARE_BUTTON_EVENT); Loading @@ -220,8 +204,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { break; } mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, TASK_START_EVENT); mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY); } protected String getSwipeHeightRequestName() { Loading tests/tapl/com/android/launcher3/tapl/Launchable.java +2 −5 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.UiObject2; import androidx.test.uiautomator.Until; import com.android.launcher3.testing.TestProtocol; /** * Ancestor for AppIcon and AppMenuItem. */ Loading Loading @@ -64,8 +62,6 @@ abstract class Launchable { event -> event.getEventType() == TYPE_WINDOW_STATE_CHANGED, () -> "Launching an app didn't open a new window: " + mObject.getText()); expectActivityStartEvents(); mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY); mLauncher.assertTrue( "App didn't start: " + selector, Loading @@ -76,6 +72,7 @@ abstract class Launchable { /** * Drags an object to the center of homescreen. * * @param startsActivity whether it's expected to start an activity. * @param isWidgetShortcut whether we drag a widget shortcut */ Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +0 −8 Original line number Diff line number Diff line Loading @@ -97,8 +97,6 @@ public final class LauncherInstrumentation { private static final Pattern EVENT_TOUCH_UP = getTouchEventPattern("ACTION_UP"); private static final Pattern EVENT_TOUCH_CANCEL = getTouchEventPattern("ACTION_CANCEL"); private static final Pattern EVENT_PILFER_POINTERS = Pattern.compile("pilferPointers"); static final Pattern EVENT_START_ACTIVITY = Pattern.compile("Activity\\.onStart"); static final Pattern EVENT_STOP_ACTIVITY = Pattern.compile("Activity\\.onStop"); static final Pattern EVENT_START = Pattern.compile("start:"); static final Pattern EVENT_TOUCH_DOWN_TIS = getTouchEventPatternTIS("ACTION_DOWN"); Loading Loading @@ -680,14 +678,8 @@ public final class LauncherInstrumentation { ? GestureScope.INSIDE_TO_OUTSIDE : GestureScope.OUTSIDE); } if (!launcherWasVisible) { expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_START_ACTIVITY); } } } else { if (!launcherWasVisible) { expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_START_ACTIVITY); } log("Hierarchy before clicking home:"); dumpViewHierarchy(); log(action = "clicking home button from " + getVisibleStateMessage()); Loading tests/tapl/com/android/launcher3/tapl/OptionsPopupMenuItem.java +0 −8 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ */ package com.android.launcher3.tapl; import android.os.Build; import androidx.annotation.NonNull; import androidx.test.uiautomator.By; import androidx.test.uiautomator.UiObject2; Loading Loading @@ -44,12 +42,6 @@ public class OptionsPopupMenuItem { + mObject.getVisibleCenter() + " in " + mLauncher.getVisibleBounds(mObject)); mLauncher.clickLauncherObject(mObject); mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START); if (!Build.MODEL.contains("Cuttlefish") || Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q && !"R".equals(Build.VERSION.CODENAME)) { mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY); } mLauncher.assertTrue( "App didn't start: " + By.pkg(expectedPackageName), mLauncher.getDevice().wait(Until.hasObject(By.pkg(expectedPackageName)), Loading Loading
src/com/android/launcher3/Launcher.java +0 −3 Original line number Diff line number Diff line Loading @@ -923,8 +923,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, } }); } TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Activity.onStop"); } @Override Loading @@ -938,7 +936,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, mAppWidgetHost.setListenIfResumed(true); TraceHelper.INSTANCE.endSection(traceToken); TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Activity.onStart"); } private void handleDeferredResume() { Loading
tests/tapl/com/android/launcher3/tapl/Background.java +0 −18 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { } protected void goToOverviewUnchecked() { final boolean launcherWasVisible = mLauncher.isLauncherVisible(); switch (mLauncher.getNavigationModel()) { case ZERO_BUTTON: { final int centerX = mLauncher.getDevice().getDisplayWidth() / 2; Loading Loading @@ -138,11 +137,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { break; } expectSwitchToOverviewEvents(); if (!launcherWasVisible) { mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START_ACTIVITY); } } private void expectSwitchToOverviewEvents() { Loading Loading @@ -192,11 +186,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { } final boolean isZeroButton = mLauncher.getNavigationModel() == LauncherInstrumentation.NavigationModel.ZERO_BUTTON; if (!launcherWasVisible) { mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START_ACTIVITY); } mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState, launcherWasVisible && isZeroButton ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE Loading @@ -208,11 +197,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { // Double press the recents button. UiObject2 recentsButton = mLauncher.waitForSystemUiObject("recent_apps"); mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, SQUARE_BUTTON_EVENT); if (!launcherWasVisible) { mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START_ACTIVITY); } mLauncher.runToState(() -> recentsButton.click(), OVERVIEW_STATE_ORDINAL); mLauncher.getOverview(); mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, SQUARE_BUTTON_EVENT); Loading @@ -220,8 +204,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { break; } mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, TASK_START_EVENT); mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY); } protected String getSwipeHeightRequestName() { Loading
tests/tapl/com/android/launcher3/tapl/Launchable.java +2 −5 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.UiObject2; import androidx.test.uiautomator.Until; import com.android.launcher3.testing.TestProtocol; /** * Ancestor for AppIcon and AppMenuItem. */ Loading Loading @@ -64,8 +62,6 @@ abstract class Launchable { event -> event.getEventType() == TYPE_WINDOW_STATE_CHANGED, () -> "Launching an app didn't open a new window: " + mObject.getText()); expectActivityStartEvents(); mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY); mLauncher.assertTrue( "App didn't start: " + selector, Loading @@ -76,6 +72,7 @@ abstract class Launchable { /** * Drags an object to the center of homescreen. * * @param startsActivity whether it's expected to start an activity. * @param isWidgetShortcut whether we drag a widget shortcut */ Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +0 −8 Original line number Diff line number Diff line Loading @@ -97,8 +97,6 @@ public final class LauncherInstrumentation { private static final Pattern EVENT_TOUCH_UP = getTouchEventPattern("ACTION_UP"); private static final Pattern EVENT_TOUCH_CANCEL = getTouchEventPattern("ACTION_CANCEL"); private static final Pattern EVENT_PILFER_POINTERS = Pattern.compile("pilferPointers"); static final Pattern EVENT_START_ACTIVITY = Pattern.compile("Activity\\.onStart"); static final Pattern EVENT_STOP_ACTIVITY = Pattern.compile("Activity\\.onStop"); static final Pattern EVENT_START = Pattern.compile("start:"); static final Pattern EVENT_TOUCH_DOWN_TIS = getTouchEventPatternTIS("ACTION_DOWN"); Loading Loading @@ -680,14 +678,8 @@ public final class LauncherInstrumentation { ? GestureScope.INSIDE_TO_OUTSIDE : GestureScope.OUTSIDE); } if (!launcherWasVisible) { expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_START_ACTIVITY); } } } else { if (!launcherWasVisible) { expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_START_ACTIVITY); } log("Hierarchy before clicking home:"); dumpViewHierarchy(); log(action = "clicking home button from " + getVisibleStateMessage()); Loading
tests/tapl/com/android/launcher3/tapl/OptionsPopupMenuItem.java +0 −8 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ */ package com.android.launcher3.tapl; import android.os.Build; import androidx.annotation.NonNull; import androidx.test.uiautomator.By; import androidx.test.uiautomator.UiObject2; Loading Loading @@ -44,12 +42,6 @@ public class OptionsPopupMenuItem { + mObject.getVisibleCenter() + " in " + mLauncher.getVisibleBounds(mObject)); mLauncher.clickLauncherObject(mObject); mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START); if (!Build.MODEL.contains("Cuttlefish") || Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q && !"R".equals(Build.VERSION.CODENAME)) { mLauncher.expectEvent( TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY); } mLauncher.assertTrue( "App didn't start: " + By.pkg(expectedPackageName), mLauncher.getDevice().wait(Until.hasObject(By.pkg(expectedPackageName)), Loading