Chromium Code Reviews| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc |
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc |
| index 595edf10c28fef86a06bdb53c79221a4b2805944..b726e0741e8b7dc73d56a8450d0fd5d243413eb0 100644 |
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc |
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc |
| @@ -10,23 +10,25 @@ |
| #include "net/url_request/url_request_test_util.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| -namespace data_reduction_proxy { |
| +using testing::_; |
| -TestDataReductionProxyConfig::TestDataReductionProxyConfig() |
| - : TestDataReductionProxyConfig(DataReductionProxyParams::kAllowed | |
| - DataReductionProxyParams::kFallbackAllowed | |
| - DataReductionProxyParams::kPromoAllowed) { |
| -} |
| +namespace data_reduction_proxy { |
| -TestDataReductionProxyConfig::TestDataReductionProxyConfig(int flags) |
| - : DataReductionProxyConfig( |
| - scoped_ptr<TestDataReductionProxyParams>( |
| - new TestDataReductionProxyParams( |
| - flags, |
| - TestDataReductionProxyParams::HAS_EVERYTHING & |
| - ~TestDataReductionProxyParams::HAS_DEV_ORIGIN & |
| - ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN)) |
| - .Pass()) { |
| +TestDataReductionProxyConfig::TestDataReductionProxyConfig( |
| + int params_flags, |
| + unsigned int params_definitions, |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| + net::NetLog* net_log, |
| + DataReductionProxyConfigurator* configurator, |
| + DataReductionProxyEventStore* event_store) |
| + : DataReductionProxyConfig(task_runner, |
|
bengr
2015/02/20 00:00:36
nit: If you move task_runner to the next line, you
jeremyim
2015/02/20 02:17:17
Done.
|
| + task_runner, |
| + net_log, |
| + make_scoped_ptr(new TestDataReductionProxyParams( |
| + params_flags, |
| + params_definitions)).Pass(), |
| + configurator, |
| + event_store) { |
| network_interfaces_.reset(new net::NetworkInterfaceList()); |
| } |
| @@ -62,24 +64,41 @@ void TestDataReductionProxyConfig::SetStateForTest( |
| enabled_by_user_ = enabled_by_user; |
| alternative_enabled_by_user_ = alternative_enabled_by_user; |
| restricted_by_carrier_ = restricted_by_carrier; |
| - SetProxyConfigs(enabled_by_user_, alternative_enabled_by_user_, |
| - restricted_by_carrier_, at_startup); |
| + UpdateConfigurator(enabled_by_user_, alternative_enabled_by_user_, |
| + restricted_by_carrier_, at_startup); |
| } |
| -MockDataReductionProxyConfig::MockDataReductionProxyConfig(int flags) |
| - : TestDataReductionProxyConfig(flags) { |
| +MockDataReductionProxyConfig::MockDataReductionProxyConfig( |
| + int params_flags, |
| + unsigned int params_definitions, |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| + net::NetLog* net_log, |
| + DataReductionProxyConfigurator* configurator, |
| + DataReductionProxyEventStore* event_store) |
| + : TestDataReductionProxyConfig(params_flags, |
|
bengr
2015/02/20 00:00:36
nit: likewise, with params_flags.
jeremyim
2015/02/20 02:17:17
Done.
|
| + params_definitions, |
| + task_runner, |
| + net_log, |
| + configurator, |
| + event_store) { |
| } |
| MockDataReductionProxyConfig::~MockDataReductionProxyConfig() { |
| } |
| -void MockDataReductionProxyConfig::SetProxyConfigs(bool enabled, |
| - bool alternative_enabled, |
| - bool restricted, |
| - bool at_startup) { |
| +void MockDataReductionProxyConfig::UpdateConfigurator(bool enabled, |
| + bool alternative_enabled, |
| + bool restricted, |
| + bool at_startup) { |
| EXPECT_CALL(*this, LogProxyState(enabled, restricted, at_startup)).Times(1); |
| - DataReductionProxyConfig::SetProxyConfigs(enabled, alternative_enabled, |
| - restricted, at_startup); |
| + DataReductionProxyConfig::UpdateConfigurator(enabled, alternative_enabled, |
| + restricted, at_startup); |
| +} |
| + |
| +void MockDataReductionProxyConfig::HandleProbeResponse( |
| + const std::string& response, |
| + const net::URLRequestStatus& status) { |
| + DataReductionProxyConfig::HandleProbeResponse(response, status); |
| } |
| } // namespace data_reduction_proxy |