Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5714)

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc

Issue 893003002: Data Reduction Proxy class ownership updates and Settings cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698