OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_test
_utils.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test
_utils.h" |
6 | 6 |
7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" | 8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" |
9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_service_client.h" | 9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_service_client.h" |
10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_test_utils.h" | 10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_test_utils.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 return *this; | 317 return *this; |
318 } | 318 } |
319 | 319 |
320 scoped_ptr<DataReductionProxyTestContext> | 320 scoped_ptr<DataReductionProxyTestContext> |
321 DataReductionProxyTestContext::Builder::Build() { | 321 DataReductionProxyTestContext::Builder::Build() { |
322 // Check for invalid builder combinations. | 322 // Check for invalid builder combinations. |
323 DCHECK(!(use_mock_config_ && use_config_client_)); | 323 DCHECK(!(use_mock_config_ && use_config_client_)); |
324 | 324 |
325 unsigned int test_context_flags = 0; | 325 unsigned int test_context_flags = 0; |
326 scoped_refptr<base::SingleThreadTaskRunner> task_runner = | 326 scoped_refptr<base::SingleThreadTaskRunner> task_runner = |
327 base::MessageLoopProxy::current(); | 327 base::ThreadTaskRunnerHandle::Get(); |
328 scoped_refptr<net::URLRequestContextGetter> request_context_getter; | 328 scoped_refptr<net::URLRequestContextGetter> request_context_getter; |
329 scoped_ptr<TestingPrefServiceSimple> pref_service( | 329 scoped_ptr<TestingPrefServiceSimple> pref_service( |
330 new TestingPrefServiceSimple()); | 330 new TestingPrefServiceSimple()); |
331 scoped_ptr<net::TestNetLog> net_log(new net::TestNetLog()); | 331 scoped_ptr<net::TestNetLog> net_log(new net::TestNetLog()); |
332 scoped_ptr<TestConfigStorer> config_storer( | 332 scoped_ptr<TestConfigStorer> config_storer( |
333 new TestConfigStorer(pref_service.get())); | 333 new TestConfigStorer(pref_service.get())); |
334 if (request_context_) { | 334 if (request_context_) { |
335 request_context_getter = new net::TrivialURLRequestContextGetter( | 335 request_context_getter = new net::TrivialURLRequestContextGetter( |
336 request_context_, task_runner); | 336 request_context_, task_runner); |
337 } else { | 337 } else { |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 : prefs_(prefs) { | 628 : prefs_(prefs) { |
629 DCHECK(prefs); | 629 DCHECK(prefs); |
630 } | 630 } |
631 | 631 |
632 void DataReductionProxyTestContext::TestConfigStorer::StoreSerializedConfig( | 632 void DataReductionProxyTestContext::TestConfigStorer::StoreSerializedConfig( |
633 const std::string& serialized_config) { | 633 const std::string& serialized_config) { |
634 prefs_->SetString(prefs::kDataReductionProxyConfig, serialized_config); | 634 prefs_->SetString(prefs::kDataReductionProxyConfig, serialized_config); |
635 } | 635 } |
636 | 636 |
637 } // namespace data_reduction_proxy | 637 } // namespace data_reduction_proxy |
OLD | NEW |