mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Adding testing for opening a widget
Bug: 140252951 Change-Id: Ic1c867db602f1890b74e7b539b44b2a440267384
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
*/
|
||||
package com.android.launcher3.ui.widget;
|
||||
|
||||
import static com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import androidx.test.filters.LargeTest;
|
||||
@@ -22,6 +25,7 @@ import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.android.launcher3.LauncherAppWidgetInfo;
|
||||
import com.android.launcher3.LauncherAppWidgetProviderInfo;
|
||||
import com.android.launcher3.tapl.Widget;
|
||||
import com.android.launcher3.ui.AbstractLauncherUiTest;
|
||||
import com.android.launcher3.ui.TestViewHelpers;
|
||||
import com.android.launcher3.util.rule.ShellCommandRule;
|
||||
@@ -59,5 +63,10 @@ public class AddWidgetTest extends AbstractLauncherUiTest {
|
||||
(info, view) -> info instanceof LauncherAppWidgetInfo &&
|
||||
((LauncherAppWidgetInfo) info).providerName.getClassName().equals(
|
||||
widgetInfo.provider.getClassName())).call());
|
||||
|
||||
final Widget widget = mLauncher.getWorkspace().tryGetWidget(widgetInfo.label,
|
||||
DEFAULT_UI_TIMEOUT);
|
||||
assertNotNull("Widget not found on the workspace", widget);
|
||||
widget.launch(getAppPackageName());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user