Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc |
index 95a890886fb6e7536eb7d45d942d773832bec93c..db0c9b6d300d1a425978feab26c9326313007fb5 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc |
@@ -14,11 +14,15 @@ |
#include "base/test/histogram_tester.h" |
#include "base/time/time.h" |
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.h" |
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h" |
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.h" |
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers_test_utils.h" |
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h" |
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h" |
+#include "net/base/capturing_net_log.h" |
#include "net/base/host_port_pair.h" |
#include "net/base/load_flags.h" |
+#include "net/base/net_log.h" |
#include "net/http/http_response_headers.h" |
#include "net/url_request/url_request.h" |
#include "net/url_request/url_request_job_factory_impl.h" |
@@ -69,6 +73,7 @@ class DataReductionProxyNetworkDelegateTest : public testing::Test { |
EXPECT_TRUE(test_job_factory_.SetProtocolHandler(url::kHttpScheme, |
test_job_interceptor_)); |
context_.set_job_factory(&test_job_factory_); |
+ event_store_.reset(new DataReductionProxyEventStore(message_loop_proxy())); |
} |
scoped_ptr<net::URLRequest> FetchURLRequest( |
@@ -108,6 +113,14 @@ class DataReductionProxyNetworkDelegateTest : public testing::Test { |
return loop_.message_loop_proxy(); |
} |
+ net::NetLog* net_log() { |
+ return &net_log_; |
+ } |
+ |
+ DataReductionProxyEventStore* event_store() { |
+ return event_store_.get(); |
+ } |
+ |
private: |
base::MessageLoopForIO loop_; |
net::TestURLRequestContext context_; |
@@ -117,6 +130,8 @@ class DataReductionProxyNetworkDelegateTest : public testing::Test { |
net::URLRequestJobFactoryImpl test_job_factory_; |
net::NetworkDelegate* network_delegate_; |
+ net::CapturingNetLog net_log_; |
+ scoped_ptr<DataReductionProxyEventStore> event_store_; |
}; |
TEST_F(DataReductionProxyNetworkDelegateTest, AuthenticationTest) { |
@@ -133,11 +148,15 @@ TEST_F(DataReductionProxyNetworkDelegateTest, AuthenticationTest) { |
DataReductionProxyAuthRequestHandler auth_handler( |
kClient, params.get(), message_loop_proxy()); |
+ scoped_ptr<DataReductionProxyConfigurator> configurator( |
+ new DataReductionProxyConfigurator(message_loop_proxy(), net_log(), |
+ event_store())); |
+ |
scoped_ptr<DataReductionProxyNetworkDelegate> network_delegate( |
new DataReductionProxyNetworkDelegate( |
scoped_ptr<net::NetworkDelegate>(new TestNetworkDelegate()), |
params.get(), &auth_handler, |
- DataReductionProxyNetworkDelegate::ProxyConfigGetter())); |
+ configurator.get())); |
set_network_delegate(network_delegate.get()); |
scoped_ptr<net::URLRequest> fake_request( |
@@ -194,11 +213,14 @@ TEST_F(DataReductionProxyNetworkDelegateTest, NetHistograms) { |
kClient, params.get(), message_loop_proxy()); |
base::HistogramTester histogram_tester; |
+ scoped_ptr<DataReductionProxyConfigurator> configurator( |
+ new DataReductionProxyConfigurator(message_loop_proxy(), net_log(), |
+ event_store())); |
scoped_ptr<DataReductionProxyNetworkDelegate> network_delegate( |
new DataReductionProxyNetworkDelegate( |
scoped_ptr<net::NetworkDelegate>( |
new TestNetworkDelegate()), params.get(), &auth_handler, |
- DataReductionProxyNetworkDelegate::ProxyConfigGetter())); |
+ configurator.get())); |
set_network_delegate(network_delegate.get()); |