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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java

Issue 2030773002: Add unit tests for the Background Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback per DougArnett Created 4 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/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
index 34aba7a8fb834121a67ab1593fe3113f09724706..dfcacab4f26713262f1f277b81ed2f16ff9d2551 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
@@ -9,7 +9,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
import android.os.Environment;
-import android.os.SystemClock;
import org.chromium.base.Log;
import org.chromium.base.metrics.RecordHistogram;
@@ -206,7 +205,7 @@ public class OfflinePageUtils {
* Records UMA data when the Offline Pages Background Load service awakens.
* @param context android context
*/
- public static void recordWakeupUMA(Context context, long millisSinceBootTask) {
+ public static void recordWakeupUMA(Context context, long millisTaskStart) {
dougarnett 2016/06/03 21:51:53 taskScheduledTimeMillis?
Pete Williamson 2016/06/03 23:52:29 Done.
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
// Note this is a sticky intent, so we aren't really registering a receiver, just getting
// the sticky intent. That means that we don't need to unregister the filter later.
@@ -228,8 +227,8 @@ public class OfflinePageUtils {
connectionType, ConnectionType.CONNECTION_LAST + 1);
// Collect UMA on the time since the request started.
- long milliSinceBootNow = SystemClock.elapsedRealtime();
- long delayInMilliseconds = milliSinceBootNow - millisSinceBootTask;
+ long milliNow = System.currentTimeMillis();
dewittj 2016/06/03 21:21:49 Same here, unrelated to tests so should be in a di
dougarnett 2016/06/03 21:51:53 fwiw, I am happy with this followup here if you wa
dougarnett 2016/06/03 21:51:53 nowMillis
Pete Williamson 2016/06/03 22:14:18 Done.
Pete Williamson 2016/06/03 23:52:29 Done.
+ long delayInMilliseconds = milliNow - millisTaskStart;
if (delayInMilliseconds <= 0) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698