Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java

Issue 2930553002: Add UMA metric to track the time elapsed since a WebAPK was last launched (Closed)
Patch Set: Merge branch 'master' into last_launched2 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 89b2c24d013ecb491c791670e09913ce6e5e6431..bfdcde581c3dde6a3ad420ff671ff181108f8a08 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
@@ -187,11 +187,11 @@ public class WebappDataStorageTest {
// Opening a data storage doesn't count as a launch.
WebappDataStorage storage = WebappDataStorage.open("test");
- assertTrue(!storage.wasLaunchedRecently());
+ assertTrue(!storage.wasUsedRecently());
// When the last used time is updated, then it is a launch.
storage.updateLastUsedTime();
- assertTrue(storage.wasLaunchedRecently());
+ assertTrue(storage.wasUsedRecently());
long lastUsedTime = mSharedPreferences.getLong(
WebappDataStorage.KEY_LAST_USED, WebappDataStorage.TIMESTAMP_INVALID);
@@ -202,29 +202,29 @@ public class WebappDataStorageTest {
mSharedPreferences.edit()
.putLong(WebappDataStorage.KEY_LAST_USED, lastUsedTime - TimeUnit.DAYS.toMillis(1L))
.apply();
- assertTrue(storage.wasLaunchedRecently());
+ assertTrue(storage.wasUsedRecently());
// Move the last used time three days in the past.
mSharedPreferences.edit()
.putLong(WebappDataStorage.KEY_LAST_USED, lastUsedTime - TimeUnit.DAYS.toMillis(3L))
.apply();
- assertTrue(storage.wasLaunchedRecently());
+ assertTrue(storage.wasUsedRecently());
// Move the last used time one week in the past.
mSharedPreferences.edit()
.putLong(WebappDataStorage.KEY_LAST_USED, lastUsedTime - TimeUnit.DAYS.toMillis(7L))
.apply();
- assertTrue(storage.wasLaunchedRecently());
+ assertTrue(storage.wasUsedRecently());
// Move the last used time just under ten days in the past.
mSharedPreferences.edit().putLong(WebappDataStorage.KEY_LAST_USED,
lastUsedTime - TimeUnit.DAYS.toMillis(10L) + 1).apply();
- assertTrue(storage.wasLaunchedRecently());
+ assertTrue(storage.wasUsedRecently());
// Move the last used time to exactly ten days in the past.
mSharedPreferences.edit().putLong(WebappDataStorage.KEY_LAST_USED,
lastUsedTime - TimeUnit.DAYS.toMillis(10L)).apply();
- assertTrue(!storage.wasLaunchedRecently());
+ assertTrue(!storage.wasUsedRecently());
}
@Test

Powered by Google App Engine
This is Rietveld 408576698