Chromium Code Reviews| 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(); |