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

Side by Side Diff: components/domain_reliability/monitor_unittest.cc

Issue 2336043007: Domain Reliability: Don't crash on shutdown with uploads pending (Closed)
Patch Set: Remove outdated comment. Created 4 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 unified diff | Download patch
« no previous file with comments | « components/domain_reliability/monitor.cc ('k') | components/domain_reliability/service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 time_(new MockTime()), 61 time_(new MockTime()),
62 monitor_("test-reporter", 62 monitor_("test-reporter",
63 pref_task_runner_, 63 pref_task_runner_,
64 network_task_runner_, 64 network_task_runner_,
65 std::unique_ptr<MockableTime>(time_)) { 65 std::unique_ptr<MockableTime>(time_)) {
66 monitor_.MoveToNetworkThread(); 66 monitor_.MoveToNetworkThread();
67 monitor_.InitURLRequestContext(url_request_context_getter_); 67 monitor_.InitURLRequestContext(url_request_context_getter_);
68 monitor_.SetDiscardUploads(false); 68 monitor_.SetDiscardUploads(false);
69 } 69 }
70 70
71 ~DomainReliabilityMonitorTest() override {
72 monitor_.Shutdown();
73 }
74
71 static RequestInfo MakeRequestInfo() { 75 static RequestInfo MakeRequestInfo() {
72 RequestInfo request; 76 RequestInfo request;
73 request.status = net::URLRequestStatus(); 77 request.status = net::URLRequestStatus();
74 request.response_info.socket_address = 78 request.response_info.socket_address =
75 net::HostPortPair::FromString("12.34.56.78:80"); 79 net::HostPortPair::FromString("12.34.56.78:80");
76 request.response_info.headers = MakeHttpResponseHeaders( 80 request.response_info.headers = MakeHttpResponseHeaders(
77 "HTTP/1.1 200 OK\n\n"); 81 "HTTP/1.1 200 OK\n\n");
78 request.response_info.was_cached = false; 82 request.response_info.was_cached = false;
79 request.response_info.network_accessed = true; 83 request.response_info.network_accessed = true;
80 request.response_info.was_fetched_via_proxy = false; 84 request.response_info.was_fetched_via_proxy = false;
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 request.status = net::URLRequestStatus::FromError(net::ERR_CONNECTION_RESET); 451 request.status = net::URLRequestStatus::FromError(net::ERR_CONNECTION_RESET);
448 OnRequestLegComplete(request); 452 OnRequestLegComplete(request);
449 453
450 EXPECT_EQ(1u, CountQueuedBeacons(context1)); 454 EXPECT_EQ(1u, CountQueuedBeacons(context1));
451 EXPECT_EQ(0u, CountQueuedBeacons(context2)); 455 EXPECT_EQ(0u, CountQueuedBeacons(context2));
452 } 456 }
453 457
454 } // namespace 458 } // namespace
455 459
456 } // namespace domain_reliability 460 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « components/domain_reliability/monitor.cc ('k') | components/domain_reliability/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698