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

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

Issue 1178703010: Add elapsed time and timeout value to feedback data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary change to EnumMap creation. 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 | « chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerCollector.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests_shell/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerCollectorTest.java
diff --git a/chrome/android/javatests_shell/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerCollectorTest.java b/chrome/android/javatests_shell/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerCollectorTest.java
index f5860c18cd69c80af74240dc61e6b443a34926b8..0bf2b727b8646ed1c5f9de54ac3ef9a19e1b899e 100644
--- a/chrome/android/javatests_shell/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerCollectorTest.java
+++ b/chrome/android/javatests_shell/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerCollectorTest.java
@@ -68,6 +68,8 @@ public class ConnectivityCheckerCollectorTest extends ConnectivityCheckerTestBas
fail("Failed to recognize type " + re.getKey());
}
}
+ assertTrue("The elapsed time should be non-negative.", feedback.getElapsedTimeMs() >= 0);
+ assertEquals("The timeout value is wrong.", TIMEOUT_MS, feedback.getTimeoutMs());
}
@MediumTest
@@ -110,6 +112,8 @@ public class ConnectivityCheckerCollectorTest extends ConnectivityCheckerTestBas
fail("Failed to recognize type " + re.getKey());
}
}
+ assertTrue("The elapsed time should be non-negative.", feedback.getElapsedTimeMs() >= 0);
+ assertEquals("The timeout value is wrong.", TIMEOUT_MS, feedback.getTimeoutMs());
}
@SmallTest
@@ -120,10 +124,10 @@ public class ConnectivityCheckerCollectorTest extends ConnectivityCheckerTestBas
connectionMap.put(Type.SYSTEM_HTTP, Result.UNKNOWN);
connectionMap.put(Type.SYSTEM_HTTPS, Result.CONNECTED);
- FeedbackData feedback = new FeedbackData(connectionMap);
+ FeedbackData feedback = new FeedbackData(connectionMap, 42, 21);
Map<String, String> map = feedback.toMap();
- assertEquals("Should have 4 entries.", 4, map.size());
+ assertEquals("Should have 6 entries.", 6, map.size());
assertTrue(map.containsKey("CHROME_HTTP"));
assertEquals("NOT_CONNECTED", map.get("CHROME_HTTP"));
assertTrue(map.containsKey("CHROME_HTTPS"));
@@ -132,6 +136,10 @@ public class ConnectivityCheckerCollectorTest extends ConnectivityCheckerTestBas
assertEquals("UNKNOWN", map.get("SYSTEM_HTTP"));
assertTrue(map.containsKey("SYSTEM_HTTPS"));
assertEquals("CONNECTED", map.get("SYSTEM_HTTPS"));
+ assertTrue(map.containsKey(FeedbackData.CONNECTION_CHECK_TIMEOUT_MS));
+ assertEquals("42", map.get(FeedbackData.CONNECTION_CHECK_TIMEOUT_MS));
+ assertTrue(map.containsKey(FeedbackData.CONNECTION_CHECK_ELAPSED_MS));
+ assertEquals("21", map.get(FeedbackData.CONNECTION_CHECK_ELAPSED_MS));
}
private static FeedbackData getResult(
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/feedback/ConnectivityCheckerCollector.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698