OLD | NEW |
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/browser/data_reduction_proxy_settings_
test_utils.h" | 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings_
test_utils.h" |
6 | 6 |
| 7 #include "base/bind.h" |
7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
9 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
10 #include "base/prefs/scoped_user_pref_update.h" | 11 #include "base/prefs/scoped_user_pref_update.h" |
11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
12 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names
.h" | 13 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names
.h" |
13 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" | 14 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" |
14 | 15 |
15 using testing::_; | 16 using testing::_; |
16 using testing::AnyNumber; | 17 using testing::AnyNumber; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 kWarmupURLWithNoContentResponse, | 293 kWarmupURLWithNoContentResponse, |
293 "OK", | 294 "OK", |
294 FetchResult(enabled_at_startup, true), | 295 FetchResult(enabled_at_startup, true), |
295 true, | 296 true, |
296 enabled_at_startup ? 1 : 0); | 297 enabled_at_startup ? 1 : 0); |
297 scoped_ptr<DataReductionProxyConfigurator> configurator( | 298 scoped_ptr<DataReductionProxyConfigurator> configurator( |
298 new TestDataReductionProxyConfig()); | 299 new TestDataReductionProxyConfig()); |
299 settings_->SetProxyConfigurator(configurator.Pass()); | 300 settings_->SetProxyConfigurator(configurator.Pass()); |
300 scoped_refptr<net::TestURLRequestContextGetter> request_context = | 301 scoped_refptr<net::TestURLRequestContextGetter> request_context = |
301 new net::TestURLRequestContextGetter(base::MessageLoopProxy::current()); | 302 new net::TestURLRequestContextGetter(base::MessageLoopProxy::current()); |
302 settings_->InitDataReductionProxySettings(&pref_service_, | 303 |
303 &pref_service_, | 304 settings_->InitDataReductionProxySettings( |
304 request_context.get()); | 305 &pref_service_, |
| 306 &pref_service_, |
| 307 request_context.get(), |
| 308 base::Bind(&DataReductionProxySettingsTestBase:: |
| 309 RegisterSyntheticFieldTrialCallback, |
| 310 base::Unretained(this))); |
305 | 311 |
306 base::MessageLoop::current()->RunUntilIdle(); | 312 base::MessageLoop::current()->RunUntilIdle(); |
307 CheckProxyConfigs(enabled_at_startup, false, false); | 313 CheckProxyConfigs(enabled_at_startup, false, false); |
| 314 EXPECT_EQ(enabled_at_startup, proxy_enabled_); |
308 } | 315 } |
309 | 316 |
310 } // namespace data_reduction_proxy | 317 } // namespace data_reduction_proxy |
OLD | NEW |