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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc

Issue 1680893002: Moving proxy resolution logic out of NetworkDelegate and into ProxyDelegate for DataReductionProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc
index e1c1f46775c832425d27e7af128bbab2a34a5157..2c3b0fca3f6920a70ef78a20a3dfefc7f31dd9a3 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc
@@ -554,20 +554,22 @@ class DataReductionProxyBypassStatsEndToEndTest : public testing::Test {
// to cause one proxy fallback in order for the data reduction proxy to be
// fully bypassed.
drp_test_context_ =
DataReductionProxyTestContext::Builder()
.WithParamsFlags(DataReductionProxyParams::kAllowed)
.WithURLRequestContext(&context_)
.WithMockClientSocketFactory(&mock_socket_factory_)
.Build();
drp_test_context_->AttachToURLRequestContext(&context_storage_);
context_.set_client_socket_factory(&mock_socket_factory_);
+ proxy_delegate_ = drp_test_context_->io_data()->CreateProxyDelegate();
+ context_.set_proxy_delegate(proxy_delegate_.get());
}
// Create and execute a fake request using the data reduction proxy stack.
// Passing in nullptr for |retry_response_headers| indicates that the request
// is not expected to be retried.
void CreateAndExecuteRequest(const GURL& url,
const char* initial_response_headers,
const char* initial_response_body,
const char* retry_response_headers,
const char* retry_response_body) {
@@ -692,20 +694,21 @@ class DataReductionProxyBypassStatsEndToEndTest : public testing::Test {
}
net::TestDelegate* delegate() { return &delegate_; }
private:
base::MessageLoopForIO message_loop_;
net::TestDelegate delegate_;
net::MockClientSocketFactory mock_socket_factory_;
net::TestURLRequestContext context_;
net::URLRequestContextStorage context_storage_;
+ scoped_ptr<net::ProxyDelegate> proxy_delegate_;
bengr 2016/02/08 23:23:29 #include "net/base/proxy_delegate.h"
RyanSturm 2016/02/09 00:46:02 Done.
scoped_ptr<DataReductionProxyTestContext> drp_test_context_;
};
TEST_F(DataReductionProxyBypassStatsEndToEndTest, BypassedBytesNoRetry) {
struct TestCase {
GURL url;
const char* histogram_name;
const char* initial_response_headers;
};
const TestCase test_cases[] = {

Powered by Google App Engine
This is Rietveld 408576698