Loading tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +12 −0 Original line number Diff line number Diff line Loading @@ -588,4 +588,16 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { public static String getAppPackageName() { return getInstrumentation().getContext().getPackageName(); } @Test public void testGetAppIconName() { HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps(); allApps.freeze(); try { HomeAppIcon icon = allApps.getAppIcon(APP_NAME); assertEquals("Wrong app icon name.", icon.getIconName(), APP_NAME); } finally { allApps.unfreeze(); } } } tests/tapl/com/android/launcher3/tapl/AppIcon.java +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.tapl; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.test.uiautomator.By; import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.UiObject2; Loading Loading @@ -86,4 +87,10 @@ public abstract class AppIcon extends Launchable { protected String launchableType() { return "app icon"; } /** Return the app name of a icon */ @NonNull public String getIconName() { return getObject().getText(); } } Loading
tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +12 −0 Original line number Diff line number Diff line Loading @@ -588,4 +588,16 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { public static String getAppPackageName() { return getInstrumentation().getContext().getPackageName(); } @Test public void testGetAppIconName() { HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps(); allApps.freeze(); try { HomeAppIcon icon = allApps.getAppIcon(APP_NAME); assertEquals("Wrong app icon name.", icon.getIconName(), APP_NAME); } finally { allApps.unfreeze(); } } }
tests/tapl/com/android/launcher3/tapl/AppIcon.java +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.tapl; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.test.uiautomator.By; import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.UiObject2; Loading Loading @@ -86,4 +87,10 @@ public abstract class AppIcon extends Launchable { protected String launchableType() { return "app icon"; } /** Return the app name of a icon */ @NonNull public String getIconName() { return getObject().getText(); } }