Loading tests/tapl/com/android/launcher3/tapl/Background.java +3 −5 Original line number Diff line number Diff line Loading @@ -17,11 +17,10 @@ package com.android.launcher3.tapl; import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS; import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName; import static org.junit.Assert.assertTrue; import static androidx.test.InstrumentationRegistry.getTargetContext; import androidx.annotation.NonNull; import androidx.test.uiautomator.By; import androidx.test.uiautomator.UiObject2; Loading Loading @@ -52,9 +51,8 @@ public class Background extends LauncherInstrumentation.VisibleContainer { public BaseOverview switchToOverview() { verifyActiveContainer(); goToOverviewUnchecked(); assertTrue("Overview not visible", mLauncher.getDevice().wait(Until.hasObject(By.pkg( getTargetContext().getPackageName())), WAIT_TIME_MS)); assertTrue("Overview not visible", mLauncher.getDevice().wait( Until.hasObject(By.pkg(getOverviewPackageName())), WAIT_TIME_MS)); return new BaseOverview(mLauncher); } Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +0 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.launcher3.tapl; import com.android.launcher3.tapl.LauncherInstrumentation.ContainerType; import java.util.Collections; import java.util.List; Loading tests/tapl/com/android/launcher3/tapl/TestHelpers.java +11 −0 Original line number Diff line number Diff line Loading @@ -20,10 +20,12 @@ import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.InstrumentationRegistry.getTargetContext; import android.app.Instrumentation; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ResolveInfo; import android.content.res.Resources; import java.util.List; Loading Loading @@ -70,4 +72,13 @@ public class TestHelpers { } return launchers.get(0).activityInfo; } public static String getOverviewPackageName() { Resources res = Resources.getSystem(); int id = res.getIdentifier("config_recentsComponentName", "string", "android"); if (id != 0) { return ComponentName.unflattenFromString(res.getString(id)).getPackageName(); } return "com.android.systemui"; } } Loading
tests/tapl/com/android/launcher3/tapl/Background.java +3 −5 Original line number Diff line number Diff line Loading @@ -17,11 +17,10 @@ package com.android.launcher3.tapl; import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS; import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName; import static org.junit.Assert.assertTrue; import static androidx.test.InstrumentationRegistry.getTargetContext; import androidx.annotation.NonNull; import androidx.test.uiautomator.By; import androidx.test.uiautomator.UiObject2; Loading Loading @@ -52,9 +51,8 @@ public class Background extends LauncherInstrumentation.VisibleContainer { public BaseOverview switchToOverview() { verifyActiveContainer(); goToOverviewUnchecked(); assertTrue("Overview not visible", mLauncher.getDevice().wait(Until.hasObject(By.pkg( getTargetContext().getPackageName())), WAIT_TIME_MS)); assertTrue("Overview not visible", mLauncher.getDevice().wait( Until.hasObject(By.pkg(getOverviewPackageName())), WAIT_TIME_MS)); return new BaseOverview(mLauncher); } Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +0 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.launcher3.tapl; import com.android.launcher3.tapl.LauncherInstrumentation.ContainerType; import java.util.Collections; import java.util.List; Loading
tests/tapl/com/android/launcher3/tapl/TestHelpers.java +11 −0 Original line number Diff line number Diff line Loading @@ -20,10 +20,12 @@ import static androidx.test.InstrumentationRegistry.getInstrumentation; import static androidx.test.InstrumentationRegistry.getTargetContext; import android.app.Instrumentation; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ResolveInfo; import android.content.res.Resources; import java.util.List; Loading Loading @@ -70,4 +72,13 @@ public class TestHelpers { } return launchers.get(0).activityInfo; } public static String getOverviewPackageName() { Resources res = Resources.getSystem(); int id = res.getIdentifier("config_recentsComponentName", "string", "android"); if (id != 0) { return ComponentName.unflattenFromString(res.getString(id)).getPackageName(); } return "com.android.systemui"; } }