mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Merge "Add getIconName to AppIcon" into tm-qpr-dev
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user