import android.content.pm.PackageInfo;
import android.os.HandlerThread;
import android.test.mock.MockPackageManager;
+import android.test.suitebuilder.annotation.SmallTest;
import org.chromium.chrome.shell.ChromeShellTestBase;
import org.chromium.content.browser.test.util.Criteria;
* Tests what happens when the InstallerDelegate detects that the package has successfully
* been installed.
*/
+ @SmallTest
public void testInstallSuccessful() throws InterruptedException {
mTestDelegate.setTimingForTests(1, 5000);
startMonitoring();
/**
* Tests what happens when the InstallerDelegate task is canceled.
*/
+ @SmallTest
public void testInstallWaitUntilCancel() throws InterruptedException {
mTestDelegate.setTimingForTests(1, 5000);
startMonitoring();
/**
* Tests what happens when the InstallerDelegate times out.
*/
+ @SmallTest
public void testInstallTimeout() throws InterruptedException {
mTestDelegate.setTimingForTests(1, 50);
startMonitoring();
/**
* Makes sure that the runnable isn't called until returning from start().
*/
+ @SmallTest
public void testRunnableRaceCondition() throws InterruptedException {
mPackageManager.isInstalled = true;
mTestDelegate.setTimingForTests(1, 5000);