OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/domain_reliability/monitor.h" | 5 #include "components/domain_reliability/monitor.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 OnRequestLegComplete(request); | 229 OnRequestLegComplete(request); |
230 | 230 |
231 EXPECT_EQ(1u, CountPendingBeacons(kAlwaysReportIndex)); | 231 EXPECT_EQ(1u, CountPendingBeacons(kAlwaysReportIndex)); |
232 EXPECT_TRUE(CheckRequestCounts(kAlwaysReportIndex, 1u, 0u)); | 232 EXPECT_TRUE(CheckRequestCounts(kAlwaysReportIndex, 1u, 0u)); |
233 | 233 |
234 BeaconVector beacons; | 234 BeaconVector beacons; |
235 context_->GetQueuedDataForTesting(kAlwaysReportIndex, &beacons, NULL, NULL); | 235 context_->GetQueuedDataForTesting(kAlwaysReportIndex, &beacons, NULL, NULL); |
236 EXPECT_TRUE(beacons[0].server_ip.empty()); | 236 EXPECT_TRUE(beacons[0].server_ip.empty()); |
237 } | 237 } |
238 | 238 |
239 // Disabled; does not handle when baked in configs expire. | 239 // Will fail when baked-in configs expire, as a reminder to update them. |
240 TEST_F(DomainReliabilityMonitorTest, DISABLED_AddBakedInConfigs) { | 240 // (Contact ttuttle@chromium.org if this starts failing.) |
| 241 TEST_F(DomainReliabilityMonitorTest, AddBakedInConfigs) { |
241 // AddBakedInConfigs DCHECKs that the baked-in configs parse correctly, so | 242 // AddBakedInConfigs DCHECKs that the baked-in configs parse correctly, so |
242 // this unittest will fail if someone tries to add an invalid config to the | 243 // this unittest will fail if someone tries to add an invalid config to the |
243 // source tree. | 244 // source tree. |
244 monitor_.AddBakedInConfigs(); | 245 monitor_.AddBakedInConfigs(); |
245 | 246 |
246 // Count the number of baked-in configs. | 247 // Count the number of baked-in configs. |
247 size_t num_baked_in_configs = 0; | 248 size_t num_baked_in_configs = 0; |
248 for (const char* const* p = kBakedInJsonConfigs; *p; ++p) | 249 for (const char* const* p = kBakedInJsonConfigs; *p; ++p) |
249 ++num_baked_in_configs; | 250 ++num_baked_in_configs; |
250 | 251 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 EXPECT_TRUE(CheckRequestCounts(kAlwaysReportIndex, 1u, 0u)); | 301 EXPECT_TRUE(CheckRequestCounts(kAlwaysReportIndex, 1u, 0u)); |
301 | 302 |
302 BeaconVector beacons; | 303 BeaconVector beacons; |
303 context_->GetQueuedDataForTesting(kAlwaysReportIndex, &beacons, NULL, NULL); | 304 context_->GetQueuedDataForTesting(kAlwaysReportIndex, &beacons, NULL, NULL); |
304 EXPECT_EQ(net::OK, beacons[0].chrome_error); | 305 EXPECT_EQ(net::OK, beacons[0].chrome_error); |
305 } | 306 } |
306 | 307 |
307 } // namespace | 308 } // namespace |
308 | 309 |
309 } // namespace domain_reliability | 310 } // namespace domain_reliability |
OLD | NEW |