Loading tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java +15 −8 Original line number Diff line number Diff line Loading @@ -82,7 +82,6 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest { runTest(false); } /** * @param acceptConfig accept the config activity */ Loading @@ -101,7 +100,7 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest { // Verify that the widget id is valid and bound assertNotNull(mAppWidgetManager.getAppWidgetInfo(mWidgetId)); setResult(acceptConfig); setResultAndWaitForAnimation(acceptConfig); if (acceptConfig) { Wait.atMost("", new WidgetSearchCondition(), DEFAULT_ACTIVITY_TIMEOUT, mLauncher); assertNotNull(mAppWidgetManager.getAppWidgetInfo(mWidgetId)); Loading @@ -112,13 +111,21 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest { } } private void setResult(boolean success) { mLauncher.executeAndWaitForWallpaperAnimation(() -> private static void setResult(boolean success) { getInstrumentation().getTargetContext().sendBroadcast( WidgetConfigActivity.getCommandIntent(WidgetConfigActivity.class, success ? "clickOK" : "clickCancel")), success ? "clickOK" : "clickCancel")); } private void setResultAndWaitForAnimation(boolean success) { if (mLauncher.isLauncher3()) { setResult(success); } else { mLauncher.executeAndWaitForWallpaperAnimation( () -> setResult(success), "setting widget coinfig result"); } } /** * Condition for searching widget id Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +2 −1 Original line number Diff line number Diff line Loading @@ -2180,7 +2180,8 @@ public final class LauncherInstrumentation { }; } boolean isLauncher3() { /** Returns whether the Launcher is a Launcher3 one */ public boolean isLauncher3() { if (mIsLauncher3 == null) { mIsLauncher3 = "com.android.launcher3".equals(getLauncherPackageName()); } Loading Loading
tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java +15 −8 Original line number Diff line number Diff line Loading @@ -82,7 +82,6 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest { runTest(false); } /** * @param acceptConfig accept the config activity */ Loading @@ -101,7 +100,7 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest { // Verify that the widget id is valid and bound assertNotNull(mAppWidgetManager.getAppWidgetInfo(mWidgetId)); setResult(acceptConfig); setResultAndWaitForAnimation(acceptConfig); if (acceptConfig) { Wait.atMost("", new WidgetSearchCondition(), DEFAULT_ACTIVITY_TIMEOUT, mLauncher); assertNotNull(mAppWidgetManager.getAppWidgetInfo(mWidgetId)); Loading @@ -112,13 +111,21 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest { } } private void setResult(boolean success) { mLauncher.executeAndWaitForWallpaperAnimation(() -> private static void setResult(boolean success) { getInstrumentation().getTargetContext().sendBroadcast( WidgetConfigActivity.getCommandIntent(WidgetConfigActivity.class, success ? "clickOK" : "clickCancel")), success ? "clickOK" : "clickCancel")); } private void setResultAndWaitForAnimation(boolean success) { if (mLauncher.isLauncher3()) { setResult(success); } else { mLauncher.executeAndWaitForWallpaperAnimation( () -> setResult(success), "setting widget coinfig result"); } } /** * Condition for searching widget id Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +2 −1 Original line number Diff line number Diff line Loading @@ -2180,7 +2180,8 @@ public final class LauncherInstrumentation { }; } boolean isLauncher3() { /** Returns whether the Launcher is a Launcher3 one */ public boolean isLauncher3() { if (mIsLauncher3 == null) { mIsLauncher3 = "com.android.launcher3".equals(getLauncherPackageName()); } Loading