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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityTask.java

Issue 1211283005: [Feedback] Add simple test for FeedbackCollector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-connectivity-task-callback
Patch Set: Rebased Created 5 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityTask.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityTask.java b/chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityTask.java
index e355f0204033e33098e328abb1b3ec995d3df1d2..b2a14ad11c0ba5f298cfaa3e8dd4e65cdfef7f38 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityTask.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityTask.java
@@ -31,7 +31,7 @@ public class ConnectivityTask {
* This string is user visible.
*/
@VisibleForTesting
- static final String CONNECTION_CHECK_TIMEOUT_MS = "Connection check timeout (ms)";
+ static final String CONNECTION_CHECK_TIMEOUT_KEY = "Connection check timeout (ms)";
/**
* The key for the data describing how long time from the connection check was started,
@@ -39,7 +39,7 @@ public class ConnectivityTask {
* This string is user visible.
*/
@VisibleForTesting
- static final String CONNECTION_CHECK_ELAPSED_MS = "Connection check elapsed (ms)";
+ static final String CONNECTION_CHECK_ELAPSED_KEY = "Connection check elapsed (ms)";
/**
* The key for the data describing whether Chrome was able to successfully connect to the
@@ -163,8 +163,8 @@ public class ConnectivityTask {
map.put(getHumanReadableString(entry.getKey()),
getHumanReadableString(entry.getValue()));
}
- map.put(CONNECTION_CHECK_TIMEOUT_MS, String.valueOf(mTimeoutMs));
- map.put(CONNECTION_CHECK_ELAPSED_MS, String.valueOf(mElapsedTimeMs));
+ map.put(CONNECTION_CHECK_TIMEOUT_KEY, String.valueOf(mTimeoutMs));
+ map.put(CONNECTION_CHECK_ELAPSED_KEY, String.valueOf(mElapsedTimeMs));
return map;
}
}
@@ -233,10 +233,16 @@ public class ConnectivityTask {
private final ConnectivityResult mCallback;
private final long mStartCheckTimeMs;
- private ConnectivityTask(Profile profile, int timeoutMs, ConnectivityResult callback) {
+ @VisibleForTesting
+ ConnectivityTask(Profile profile, int timeoutMs, ConnectivityResult callback) {
mTimeoutMs = timeoutMs;
mCallback = callback;
mStartCheckTimeMs = SystemClock.elapsedRealtime();
+ init(profile, timeoutMs);
+ }
+
+ @VisibleForTesting
+ void init(Profile profile, int timeoutMs) {
for (Type t : Type.values()) {
SingleTypeTask task = new SingleTypeTask(t);
task.start(profile, timeoutMs);
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698