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

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

Issue 252613002: Domain Reliability: More security review. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
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/context.h" 5 #include "components/domain_reliability/context.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop/message_loop_proxy.h" 12 #include "base/message_loop/message_loop_proxy.h"
13 #include "components/domain_reliability/dispatcher.h" 13 #include "components/domain_reliability/dispatcher.h"
14 #include "components/domain_reliability/scheduler.h" 14 #include "components/domain_reliability/scheduler.h"
15 #include "components/domain_reliability/test_util.h" 15 #include "components/domain_reliability/test_util.h"
16 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
17 #include "net/url_request/url_request_test_util.h" 17 #include "net/url_request/url_request_test_util.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 namespace domain_reliability { 20 namespace domain_reliability {
21
22 namespace { 21 namespace {
23 22
24 typedef std::vector<DomainReliabilityBeacon> BeaconVector; 23 typedef std::vector<DomainReliabilityBeacon> BeaconVector;
25 24
26 DomainReliabilityBeacon MakeBeacon(MockableTime* time) { 25 DomainReliabilityBeacon MakeBeacon(MockableTime* time) {
27 DomainReliabilityBeacon beacon; 26 DomainReliabilityBeacon beacon;
28 beacon.status = "ok"; 27 beacon.status = "ok";
29 beacon.chrome_error = net::OK; 28 beacon.chrome_error = net::OK;
30 beacon.server_ip = "127.0.0.1"; 29 beacon.server_ip = "127.0.0.1";
31 beacon.http_response_code = 200; 30 beacon.http_response_code = 200;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 "\"never_report\",\"successful_requests\":0}]}"; 196 "\"never_report\",\"successful_requests\":0}]}";
198 197
199 time_.Advance(max_delay()); 198 time_.Advance(max_delay());
200 EXPECT_TRUE(upload_pending()); 199 EXPECT_TRUE(upload_pending());
201 EXPECT_EQ(kExpectedReport, upload_report()); 200 EXPECT_EQ(kExpectedReport, upload_report());
202 EXPECT_EQ(GURL("https://example/upload"), upload_url()); 201 EXPECT_EQ(GURL("https://example/upload"), upload_url());
203 CallUploadCallback(true); 202 CallUploadCallback(true);
204 } 203 }
205 204
206 } // namespace domain_reliability 205 } // namespace domain_reliability
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698