Chromium Code Reviews| Index: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java |
| diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java |
| index 3148d26f855dfda65c034995f8052e0f5cf2a742..508c0d6e59cc9a2ccb87b916aca46d5273e4c334 100644 |
| --- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java |
| +++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java |
| @@ -410,6 +410,30 @@ public class WebApkUpdateManagerTest { |
| } |
| /** |
| + * Test that if a WebAPK is expected to check update less frequently, the is-update-needed |
|
pkotwicz
2017/02/14 00:15:13
Nit: "update" -> "updates"
Xi Han
2017/02/14 22:25:46
Done.
|
| + * check is done after an extended time interval (as opposed to the usual delay). |
| + */ |
| + @Test |
| + public void testInfrequentUpdateIntervalIfNoPriorWebApkUpdate() { |
| + assertTrue(WebApkUpdateManager.INFREQUENT_UPDATE_INTERVAL |
| + > WebApkUpdateManager.FULL_CHECK_UPDATE_INTERVAL); |
| + |
| + getStorage().delete(); |
|
pkotwicz
2017/02/14 00:15:12
Why do you delete the storage?
Xi Han
2017/02/14 22:25:46
Reverted.
|
| + WebappDataStorage storage = getStorage(); |
| + |
| + // Done when WebAPK is registered in {@link WebApkActivity}. |
| + storage.updateTimeOfLastCheckForUpdatedWebManifest(); |
| + storage.updateInfrequentUpdates(true); |
| + |
| + assertFalse(updateIfNeededChecksForUpdatedWebManifest()); |
| + mClock.advance(WebApkUpdateManager.FULL_CHECK_UPDATE_INTERVAL); |
| + assertFalse(updateIfNeededChecksForUpdatedWebManifest()); |
| + mClock.advance(WebApkUpdateManager.INFREQUENT_UPDATE_INTERVAL |
| + - WebApkUpdateManager.FULL_CHECK_UPDATE_INTERVAL); |
| + assertTrue(updateIfNeededChecksForUpdatedWebManifest()); |
| + } |
| + |
| + /** |
| * Test that the is-update-needed check is tried the next time that the WebAPK is launched if |
| * Chrome is killed prior to the initial URL finishing loading. |
| */ |