Commit b187a352 authored by Peter Kotwicz's avatar Peter Kotwicz Committed by Commit Bot

[Android WebAPK Testing] Make WebappDataStorageTest closer to prod

This CL removes the
WebappDataStorage#updateTimeOfLastCheckForUpdatedWebManifest() call in
WebappDataStorageTest to make the test more representative of prod after
https://chromium-review.googlesource.com/c/chromium/src/+/936602/

BUG=None

Change-Id: I369aa2aede781915c669f8faf1ec31536a5e13b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2126468
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: default avatarGlenn Hartmann <hartmanng@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755143}
parent 1fd35f9b
......@@ -322,26 +322,17 @@ public class WebappDataStorageTest {
}
/**
* Test that if there was no previous WebAPK update attempt that the is-update-needed check is
* done after the usual delay (instead of the longer relaxed-update delay).
* Test that the is-update-needed check is done the first time that the user launches the WebAPK
* after clearing Chrome's storage.
*/
@Test
public void testRegularCheckIntervalIfNoPriorWebApkUpdate() {
assertTrue(WebappDataStorage.RELAXED_UPDATE_INTERVAL > WebappDataStorage.UPDATE_INTERVAL);
public void testCheckUpdateAfterClearChromeStorage() {
WebappDataStorage storage = getStorage();
assertFalse(storage.shouldCheckForUpdate());
mClockRule.advance(WebappDataStorage.UPDATE_INTERVAL);
assertTrue(storage.shouldCheckForUpdate());
}
private WebappDataStorage getStorage() {
WebappDataStorage storage = WebappDataStorage.open("test");
// Done when WebAPK is registered in {@link WebApkActivity}.
storage.updateTimeOfLastCheckForUpdatedWebManifest();
return storage;
return WebappDataStorage.open("test");
}
private static Bitmap createBitmap() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment