Loading tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +6 −12 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static androidx.test.InstrumentationRegistry.getInstrumentation; import static com.android.launcher3.testing.shared.TestProtocol.ICON_MISSING; import static com.android.launcher3.testing.shared.TestProtocol.WIDGET_CONFIG_NULL_EXTRA_INTENT; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; Loading Loading @@ -64,7 +63,6 @@ import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.tapl.TestHelpers; import com.android.launcher3.testcomponent.TestCommandReceiver; import com.android.launcher3.util.LooperExecutor; import com.android.launcher3.util.SimpleBroadcastReceiver; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.ExtendedLongPressTimeoutRule; Loading Loading @@ -237,16 +235,12 @@ public abstract class AbstractLauncherUiTest<LAUNCHER_TYPE extends Launcher> { } protected void clearPackageData(String pkg) throws IOException, InterruptedException { final CountDownLatch count = new CountDownLatch(2); final SimpleBroadcastReceiver broadcastReceiver = new SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, i -> count.countDown()); // We OK to make binder calls on main thread in test. broadcastReceiver.registerPkgActions(mTargetContext, pkg, Intent.ACTION_PACKAGE_RESTARTED, Intent.ACTION_PACKAGE_DATA_CLEARED); mDevice.executeShellCommand("pm clear " + pkg); assertTrue(pkg + " didn't restart", count.await(20, TimeUnit.SECONDS)); mTargetContext.unregisterReceiver(broadcastReceiver); assertTrue("pm clear command failed", mDevice.executeShellCommand("pm clear " + pkg) .contains("Success")); assertTrue("pm wait-for-handler command failed", mDevice.executeShellCommand("pm wait-for-handler") .contains("Success")); } protected TestRule getRulesInsideActivityMonitor() { Loading Loading
tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +6 −12 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static androidx.test.InstrumentationRegistry.getInstrumentation; import static com.android.launcher3.testing.shared.TestProtocol.ICON_MISSING; import static com.android.launcher3.testing.shared.TestProtocol.WIDGET_CONFIG_NULL_EXTRA_INTENT; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; Loading Loading @@ -64,7 +63,6 @@ import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.tapl.TestHelpers; import com.android.launcher3.testcomponent.TestCommandReceiver; import com.android.launcher3.util.LooperExecutor; import com.android.launcher3.util.SimpleBroadcastReceiver; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.ExtendedLongPressTimeoutRule; Loading Loading @@ -237,16 +235,12 @@ public abstract class AbstractLauncherUiTest<LAUNCHER_TYPE extends Launcher> { } protected void clearPackageData(String pkg) throws IOException, InterruptedException { final CountDownLatch count = new CountDownLatch(2); final SimpleBroadcastReceiver broadcastReceiver = new SimpleBroadcastReceiver(UI_HELPER_EXECUTOR, i -> count.countDown()); // We OK to make binder calls on main thread in test. broadcastReceiver.registerPkgActions(mTargetContext, pkg, Intent.ACTION_PACKAGE_RESTARTED, Intent.ACTION_PACKAGE_DATA_CLEARED); mDevice.executeShellCommand("pm clear " + pkg); assertTrue(pkg + " didn't restart", count.await(20, TimeUnit.SECONDS)); mTargetContext.unregisterReceiver(broadcastReceiver); assertTrue("pm clear command failed", mDevice.executeShellCommand("pm clear " + pkg) .contains("Success")); assertTrue("pm wait-for-handler command failed", mDevice.executeShellCommand("pm wait-for-handler") .contains("Success")); } protected TestRule getRulesInsideActivityMonitor() { Loading