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

Unified Diff: components/domain_reliability/context_unittest.cc

Issue 1497803004: Domain Reliability: Add sample_rate field to Beacon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ...actually make sample_rate a double :P Created 5 years 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: components/domain_reliability/context_unittest.cc
diff --git a/components/domain_reliability/context_unittest.cc b/components/domain_reliability/context_unittest.cc
index 5b42d2187b50a1849d398f5c9bf890df4d07e5b9..a78d43376a9b1b3d50ba0263bdcab4b5874685b0 100644
--- a/components/domain_reliability/context_unittest.cc
+++ b/components/domain_reliability/context_unittest.cc
@@ -36,6 +36,7 @@ scoped_ptr<DomainReliabilityBeacon> MakeBeacon(MockableTime* time) {
beacon->elapsed = base::TimeDelta::FromMilliseconds(250);
beacon->start_time = time->NowTicks() - beacon->elapsed;
beacon->upload_depth = 0;
+ beacon->sample_rate = 1.0;
return beacon.Pass();
}
@@ -214,10 +215,10 @@ TEST_F(DomainReliabilityContextTest, ReportUpload) {
"{\"failure_data\":{\"custom_error\":\"net::ERR_CONNECTION_RESET\"},"
"\"network_changed\":false,\"protocol\":\"HTTP\","
"\"quic_broken\":true,\"request_age_ms\":300250,"
- "\"request_elapsed_ms\":250,"
+ "\"request_elapsed_ms\":250,\"sample_rate\":1.0,"
"\"server_ip\":\"127.0.0.1\",\"status\":\"tcp.connection_reset\","
- "\"url\":\"https://localhost/\","
- "\"was_proxied\":false}],\"reporter\":\"test-reporter\"}";
+ "\"url\":\"https://localhost/\",\"was_proxied\":false}],"
+ "\"reporter\":\"test-reporter\"}";
time_.Advance(max_delay());
EXPECT_TRUE(upload_pending());
@@ -245,10 +246,10 @@ TEST_F(DomainReliabilityContextTest, Upload_NetworkChanged) {
"{\"failure_data\":{\"custom_error\":\"net::ERR_CONNECTION_RESET\"},"
"\"network_changed\":true,\"protocol\":\"HTTP\","
"\"quic_broken\":true,\"request_age_ms\":300250,"
- "\"request_elapsed_ms\":250,"
+ "\"request_elapsed_ms\":250,\"sample_rate\":1.0,"
jkarlin 2015/12/09 11:46:22 Needs more tests. Include rates such as 0.0, 1.0,
Deprecated (see juliatuttle) 2015/12/10 17:04:23 I've added tests for 0.0 and 0.5 (1.0 is tested im
"\"server_ip\":\"127.0.0.1\",\"status\":\"tcp.connection_reset\","
- "\"url\":\"https://localhost/\","
- "\"was_proxied\":false}],\"reporter\":\"test-reporter\"}";
+ "\"url\":\"https://localhost/\",\"was_proxied\":false}],"
+ "\"reporter\":\"test-reporter\"}";
// Simulate a network change after the request but before the upload.
last_network_change_time_ = time_.NowTicks();
« components/domain_reliability/context.cc ('K') | « components/domain_reliability/context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698