| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..61fcb7a6225f13daf3ab594dad638063ffd1dfd5
|
| --- /dev/null
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
|
| @@ -0,0 +1,54 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
|
| +
|
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h"
|
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator_test_utils.h"
|
| +#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.h"
|
| +
|
| +namespace data_reduction_proxy {
|
| +
|
| +TestDataReductionProxyIOData::TestDataReductionProxyIOData(
|
| + TestDataReductionProxyConfig* config,
|
| + DataReductionProxyEventStore* event_store)
|
| + : DataReductionProxyIOData(), config_(config), event_store_(event_store) {
|
| +}
|
| +
|
| +TestDataReductionProxyIOData::~TestDataReductionProxyIOData() {
|
| + shutdown_on_ui_ = true;
|
| +}
|
| +
|
| +DataReductionProxyConfig* TestDataReductionProxyIOData::config() const {
|
| + return config_;
|
| +}
|
| +
|
| +DataReductionProxyEventStore* TestDataReductionProxyIOData::event_store()
|
| + const {
|
| + return event_store_;
|
| +}
|
| +
|
| +DataReductionProxyTestContext::DataReductionProxyTestContext(
|
| + bool use_mock_config)
|
| + : task_runner_(scoped_refptr<base::TestSimpleTaskRunner>(
|
| + new base::TestSimpleTaskRunner())) {
|
| + event_store_.reset(new DataReductionProxyEventStore(task_runner_));
|
| + configurator_.reset(new TestDataReductionProxyConfigurator(
|
| + task_runner_, &net_log_, event_store_.get()));
|
| + if (use_mock_config) {
|
| + config_.reset(new MockDataReductionProxyConfig(
|
| + task_runner_, &net_log_, configurator_.get(), event_store_.get()));
|
| + } else {
|
| + config_.reset(new TestDataReductionProxyConfig(
|
| + task_runner_, &net_log_, configurator_.get(), event_store_.get()));
|
| + }
|
| +
|
| + io_data_.reset(
|
| + new TestDataReductionProxyIOData(config_.get(), event_store_.get()));
|
| +}
|
| +
|
| +DataReductionProxyTestContext::~DataReductionProxyTestContext() {
|
| +}
|
| +
|
| +} // namespace data_reduction_proxy
|
|
|