Loading tests/tapl/com/android/launcher3/tapl/Background.java +0 −6 Original line number Original line Diff line number Diff line Loading @@ -17,16 +17,12 @@ package com.android.launcher3.tapl; package com.android.launcher3.tapl; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS; import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName; import android.graphics.Point; import android.graphics.Point; import android.os.SystemClock; import android.os.SystemClock; import android.view.MotionEvent; import android.view.MotionEvent; import androidx.annotation.NonNull; import androidx.annotation.NonNull; import androidx.test.uiautomator.By; import androidx.test.uiautomator.Until; import com.android.launcher3.TestProtocol; import com.android.launcher3.TestProtocol; Loading Loading @@ -59,8 +55,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { "want to switch from background to overview")) { "want to switch from background to overview")) { verifyActiveContainer(); verifyActiveContainer(); goToOverviewUnchecked(BACKGROUND_APP_STATE_ORDINAL); goToOverviewUnchecked(BACKGROUND_APP_STATE_ORDINAL); mLauncher.assertTrue("Overview not visible", mLauncher.getDevice().wait( Until.hasObject(By.pkg(getOverviewPackageName())), WAIT_TIME_MS)); return new BaseOverview(mLauncher); return new BaseOverview(mLauncher); } } } } Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { BaseOverview(LauncherInstrumentation launcher) { BaseOverview(LauncherInstrumentation launcher) { super(launcher); super(launcher); verifyActiveContainer(); } } @Override @Override Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +16 −3 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.tapl; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.TestProtocol.NORMAL_STATE_ORDINAL; import static com.android.launcher3.TestProtocol.NORMAL_STATE_ORDINAL; import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName; import android.app.ActivityManager; import android.app.ActivityManager; import android.app.Instrumentation; import android.app.Instrumentation; Loading Loading @@ -296,14 +297,14 @@ public final class LauncherInstrumentation { } else { } else { waitUntilGone(APPS_RES_ID); waitUntilGone(APPS_RES_ID); } } // Fall through } case BASE_OVERVIEW: { waitUntilGone(WORKSPACE_RES_ID); waitUntilGone(WORKSPACE_RES_ID); waitUntilGone(WIDGETS_RES_ID); waitUntilGone(WIDGETS_RES_ID); return waitForLauncherObject(OVERVIEW_RES_ID); return waitForLauncherObject(OVERVIEW_RES_ID); } } case BASE_OVERVIEW: { return waitForFallbackLauncherObject(OVERVIEW_RES_ID); } case BACKGROUND: { case BACKGROUND: { waitUntilGone(WORKSPACE_RES_ID); waitUntilGone(WORKSPACE_RES_ID); waitUntilGone(APPS_RES_ID); waitUntilGone(APPS_RES_ID); Loading Loading @@ -528,10 +529,22 @@ public final class LauncherInstrumentation { return object; return object; } } @NonNull UiObject2 waitForFallbackLauncherObject(String resName) { final BySelector selector = getFallbackLauncherObjectSelector(resName); final UiObject2 object = mDevice.wait(Until.findObject(selector), WAIT_TIME_MS); assertNotNull("Can't find a fallback launcher object; selector: " + selector, object); return object; } BySelector getLauncherObjectSelector(String resName) { BySelector getLauncherObjectSelector(String resName) { return By.res(getLauncherPackageName(), resName); return By.res(getLauncherPackageName(), resName); } } BySelector getFallbackLauncherObjectSelector(String resName) { return By.res(getOverviewPackageName(), resName); } String getLauncherPackageName() { String getLauncherPackageName() { return mDevice.getLauncherPackageName(); return mDevice.getLauncherPackageName(); } } Loading Loading
tests/tapl/com/android/launcher3/tapl/Background.java +0 −6 Original line number Original line Diff line number Diff line Loading @@ -17,16 +17,12 @@ package com.android.launcher3.tapl; package com.android.launcher3.tapl; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS; import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName; import android.graphics.Point; import android.graphics.Point; import android.os.SystemClock; import android.os.SystemClock; import android.view.MotionEvent; import android.view.MotionEvent; import androidx.annotation.NonNull; import androidx.annotation.NonNull; import androidx.test.uiautomator.By; import androidx.test.uiautomator.Until; import com.android.launcher3.TestProtocol; import com.android.launcher3.TestProtocol; Loading Loading @@ -59,8 +55,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { "want to switch from background to overview")) { "want to switch from background to overview")) { verifyActiveContainer(); verifyActiveContainer(); goToOverviewUnchecked(BACKGROUND_APP_STATE_ORDINAL); goToOverviewUnchecked(BACKGROUND_APP_STATE_ORDINAL); mLauncher.assertTrue("Overview not visible", mLauncher.getDevice().wait( Until.hasObject(By.pkg(getOverviewPackageName())), WAIT_TIME_MS)); return new BaseOverview(mLauncher); return new BaseOverview(mLauncher); } } } } Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { BaseOverview(LauncherInstrumentation launcher) { BaseOverview(LauncherInstrumentation launcher) { super(launcher); super(launcher); verifyActiveContainer(); } } @Override @Override Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +16 −3 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.tapl; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.TestProtocol.NORMAL_STATE_ORDINAL; import static com.android.launcher3.TestProtocol.NORMAL_STATE_ORDINAL; import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName; import android.app.ActivityManager; import android.app.ActivityManager; import android.app.Instrumentation; import android.app.Instrumentation; Loading Loading @@ -296,14 +297,14 @@ public final class LauncherInstrumentation { } else { } else { waitUntilGone(APPS_RES_ID); waitUntilGone(APPS_RES_ID); } } // Fall through } case BASE_OVERVIEW: { waitUntilGone(WORKSPACE_RES_ID); waitUntilGone(WORKSPACE_RES_ID); waitUntilGone(WIDGETS_RES_ID); waitUntilGone(WIDGETS_RES_ID); return waitForLauncherObject(OVERVIEW_RES_ID); return waitForLauncherObject(OVERVIEW_RES_ID); } } case BASE_OVERVIEW: { return waitForFallbackLauncherObject(OVERVIEW_RES_ID); } case BACKGROUND: { case BACKGROUND: { waitUntilGone(WORKSPACE_RES_ID); waitUntilGone(WORKSPACE_RES_ID); waitUntilGone(APPS_RES_ID); waitUntilGone(APPS_RES_ID); Loading Loading @@ -528,10 +529,22 @@ public final class LauncherInstrumentation { return object; return object; } } @NonNull UiObject2 waitForFallbackLauncherObject(String resName) { final BySelector selector = getFallbackLauncherObjectSelector(resName); final UiObject2 object = mDevice.wait(Until.findObject(selector), WAIT_TIME_MS); assertNotNull("Can't find a fallback launcher object; selector: " + selector, object); return object; } BySelector getLauncherObjectSelector(String resName) { BySelector getLauncherObjectSelector(String resName) { return By.res(getLauncherPackageName(), resName); return By.res(getLauncherPackageName(), resName); } } BySelector getFallbackLauncherObjectSelector(String resName) { return By.res(getOverviewPackageName(), resName); } String getLauncherPackageName() { String getLauncherPackageName() { return mDevice.getLauncherPackageName(); return mDevice.getLauncherPackageName(); } } Loading