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

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc

Issue 2922663002: Data Reduction Proxy: Remove duplicate functions (Closed)
Patch Set: megjablon comments Created 3 years, 6 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/data_reduction_proxy/core/browser/data_reduction_proxy_bypa ss_stats.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypa ss_stats.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 DataReductionProxyBypassStatsEndToEndTest() 251 DataReductionProxyBypassStatsEndToEndTest()
252 : context_(true), context_storage_(&context_) {} 252 : context_(true), context_storage_(&context_) {}
253 253
254 ~DataReductionProxyBypassStatsEndToEndTest() override { 254 ~DataReductionProxyBypassStatsEndToEndTest() override {
255 drp_test_context_->io_data()->ShutdownOnUIThread(); 255 drp_test_context_->io_data()->ShutdownOnUIThread();
256 drp_test_context_->RunUntilIdle(); 256 drp_test_context_->RunUntilIdle();
257 } 257 }
258 258
259 void SetUp() override { 259 void SetUp() override {
260 drp_test_context_ = DataReductionProxyTestContext::Builder() 260 drp_test_context_ = DataReductionProxyTestContext::Builder()
261 .WithParamsFlags(0)
262 .WithURLRequestContext(&context_) 261 .WithURLRequestContext(&context_)
263 .WithMockClientSocketFactory(&mock_socket_factory_) 262 .WithMockClientSocketFactory(&mock_socket_factory_)
264 .Build(); 263 .Build();
265 drp_test_context_->AttachToURLRequestContext(&context_storage_); 264 drp_test_context_->AttachToURLRequestContext(&context_storage_);
266 context_.set_client_socket_factory(&mock_socket_factory_); 265 context_.set_client_socket_factory(&mock_socket_factory_);
267 proxy_delegate_ = drp_test_context_->io_data()->CreateProxyDelegate(); 266 proxy_delegate_ = drp_test_context_->io_data()->CreateProxyDelegate();
268 context_.set_proxy_delegate(proxy_delegate_.get()); 267 context_.set_proxy_delegate(proxy_delegate_.get());
269 268
270 // Only use the primary data reduction proxy in order to make it easier to 269 // Only use the primary data reduction proxy in order to make it easier to
271 // test bypassed bytes due to proxy fallbacks. This way, a test just needs 270 // test bypassed bytes due to proxy fallbacks. This way, a test just needs
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 base::HistogramTester histogram_tester; 1076 base::HistogramTester histogram_tester;
1078 CreateAndExecuteRequest(GURL("http://bar.com"), net::LOAD_NORMAL, net::OK, 1077 CreateAndExecuteRequest(GURL("http://bar.com"), net::LOAD_NORMAL, net::OK,
1079 "HTTP/1.1 200 OK\r\n" 1078 "HTTP/1.1 200 OK\r\n"
1080 "Via: 1.1 Chrome-Compression-Proxy\r\n\r\n", 1079 "Via: 1.1 Chrome-Compression-Proxy\r\n\r\n",
1081 kNextBody.c_str(), nullptr, nullptr); 1080 kNextBody.c_str(), nullptr, nullptr);
1082 histogram_tester.ExpectUniqueSample("DataReductionProxy.ProxySchemeUsed", 1081 histogram_tester.ExpectUniqueSample("DataReductionProxy.ProxySchemeUsed",
1083 2 /*PROXY_SCHEME_HTTPS */, 1); 1082 2 /*PROXY_SCHEME_HTTPS */, 1);
1084 } 1083 }
1085 1084
1086 } // namespace data_reduction_proxy 1085 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698