| Index: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java
|
| diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java
|
| index c0b6fbca4602c40e1e8d57a661554b3da6ff2316..3afa8a6bf4cb0894823256d8e10bb9618dd924a3 100644
|
| --- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java
|
| +++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java
|
| @@ -396,6 +396,24 @@ public class WebappDataStorageTest {
|
| assertTrue(storage.shouldCheckForUpdate());
|
| }
|
|
|
| + /**
|
| + * Tests that if there was no WebAPK update attempt that the should-request-shell-apk-update
|
| + * returns true; and it returns true again after the retry interval.
|
| + */
|
| + @Test
|
| + public void testShouldRequestShellApkUpdate() {
|
| + final TestClock clock = new TestClock(System.currentTimeMillis());
|
| + WebappDataStorage storage = getStorage(clock);
|
| + assertTrue(storage.shouldRequestShellApkUpdate());
|
| +
|
| + storage.updateTimeOfLastWebApkUpdateRequestCompletion();
|
| + clock.advance(1);
|
| + assertFalse(storage.shouldRequestShellApkUpdate());
|
| +
|
| + clock.advance(WebappDataStorage.RETRY_SHELL_APK_UPDATE_DURATION - 1);
|
| + assertTrue(storage.shouldRequestShellApkUpdate());
|
| + }
|
| +
|
| private WebappDataStorage getStorage(TestClock clock) {
|
| WebappDataStorage.setClockForTests(clock);
|
| WebappDataStorage storage = WebappDataStorage.open("test");
|
|
|