| Index: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
|
| diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
|
| index 66f47e34cc3d94f3072e321ba40e986cb35eb3e3..671dc1758b752f55fe940a5e6e87396b7288b230 100644
|
| --- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
|
| +++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
|
| @@ -351,6 +351,28 @@ public class WebappRegistryTest {
|
| }
|
|
|
| @Test
|
| + @Feature({"WebApk"})
|
| + public void testCleanupRemovesUninstalledWebApks() throws Exception {
|
| + // Put the current time such that the task runs.
|
| + long currentTime = INITIAL_TIME + WebappRegistry.FULL_CLEANUP_DURATION;
|
| +
|
| + String webappId = "webapk:uninstalledWebApk";
|
| + addWebappsToRegistry(webappId);
|
| +
|
| + // Because the time is just inside the window, there should be a cleanup of uninstalled
|
| + // WebAPKs and the last cleaned up time should be set to the current time.
|
| + WebappRegistry.unregisterOldWebapps(Robolectric.application, currentTime);
|
| + BackgroundShadowAsyncTask.runBackgroundTasks();
|
| +
|
| + Set<String> actual = mSharedPreferences.getStringSet(
|
| + WebappRegistry.KEY_WEBAPP_SET, Collections.<String>emptySet());
|
| + assertTrue(actual.isEmpty());
|
| +
|
| + long lastCleanup = mSharedPreferences.getLong(WebappRegistry.KEY_LAST_CLEANUP, -1);
|
| + assertEquals(currentTime, lastCleanup);
|
| + }
|
| +
|
| + @Test
|
| @Feature({"Webapp"})
|
| public void testClearWebappHistoryRunsCallback() throws Exception {
|
| CallbackRunner callback = new CallbackRunner();
|
|
|