Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9672e2e7 authored by Ke-Yu Lu's avatar Ke-Yu Lu Committed by Android (Google) Code Review
Browse files

Merge "Add getIconName to AppIcon" into tm-qpr-dev

parents d6801af6 65203729
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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();
        }
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -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();
    }
}