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

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

Issue 267633002: Domain Reliability: Don't send proxy address, other fixes (Closed) Base URL: http://git.chromium.org/chromium/src.git@domrel_security
Patch Set: Include https://codereview.chromium.org/271593002/ Created 6 years, 7 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"
(...skipping 15 matching lines...) Expand all
26 DomainReliabilityBeacon beacon; 26 DomainReliabilityBeacon beacon;
27 beacon.status = "ok"; 27 beacon.status = "ok";
28 beacon.chrome_error = net::OK; 28 beacon.chrome_error = net::OK;
29 beacon.server_ip = "127.0.0.1"; 29 beacon.server_ip = "127.0.0.1";
30 beacon.http_response_code = 200; 30 beacon.http_response_code = 200;
31 beacon.elapsed = base::TimeDelta::FromMilliseconds(250); 31 beacon.elapsed = base::TimeDelta::FromMilliseconds(250);
32 beacon.start_time = time->NowTicks() - beacon.elapsed; 32 beacon.start_time = time->NowTicks() - beacon.elapsed;
33 return beacon; 33 return beacon;
34 } 34 }
35 35
36 } // namespace
37
38 class DomainReliabilityContextTest : public testing::Test { 36 class DomainReliabilityContextTest : public testing::Test {
39 protected: 37 protected:
40 DomainReliabilityContextTest() 38 DomainReliabilityContextTest()
41 : dispatcher_(&time_), 39 : dispatcher_(&time_),
42 params_(CreateParams()), 40 params_(CreateParams()),
43 uploader_(base::Bind(&DomainReliabilityContextTest::OnUploadRequest, 41 uploader_(base::Bind(&DomainReliabilityContextTest::OnUploadRequest,
44 base::Unretained(this))), 42 base::Unretained(this))),
45 upload_reporter_string_("test-reporter"), 43 upload_reporter_string_("test-reporter"),
46 context_(&time_, 44 context_(&time_,
47 params_, 45 params_,
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 "{\"beacons\":[],\"failed_requests\":0,\"resource_name\":" 202 "{\"beacons\":[],\"failed_requests\":0,\"resource_name\":"
205 "\"never_report\",\"successful_requests\":0}]}"; 203 "\"never_report\",\"successful_requests\":0}]}";
206 204
207 time_.Advance(max_delay()); 205 time_.Advance(max_delay());
208 EXPECT_TRUE(upload_pending()); 206 EXPECT_TRUE(upload_pending());
209 EXPECT_EQ(kExpectedReport, upload_report()); 207 EXPECT_EQ(kExpectedReport, upload_report());
210 EXPECT_EQ(GURL("https://example/upload"), upload_url()); 208 EXPECT_EQ(GURL("https://example/upload"), upload_url());
211 CallUploadCallback(true); 209 CallUploadCallback(true);
212 } 210 }
213 211
212 } // namespace
214 } // namespace domain_reliability 213 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « components/domain_reliability/context.cc ('k') | components/domain_reliability/dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698