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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h

Issue 880963006: Create a new DataReductionProxyConfig class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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_settings_test_utils.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h
index ccd8170f878036badc84ac1de38f74259bd77195..c364706e8cde4963f22e3403e2afb210357b87d7 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.h
@@ -5,10 +5,8 @@
#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TEST_UTILS_H_
#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TEST_UTILS_H_
-
#include "base/memory/scoped_ptr.h"
#include "base/prefs/testing_pref_service.h"
-#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h"
#include "net/base/capturing_net_log.h"
@@ -23,59 +21,27 @@ class TestingPrefServiceSimple;
namespace data_reduction_proxy {
+class DataReductionProxyConfigurator;
class DataReductionProxyStatisticsPrefs;
-class TestDataReductionProxyConfig : public DataReductionProxyConfigurator {
- public:
- TestDataReductionProxyConfig(
- scoped_refptr<base::SequencedTaskRunner> network_task_runner,
- net::NetLog* net_log,
- data_reduction_proxy::DataReductionProxyEventStore* event_store);
- ~TestDataReductionProxyConfig() override;
- void Enable(bool restricted,
- bool fallback_restricted,
- const std::string& primary_origin,
- const std::string& fallback_origin,
- const std::string& ssl_origin) override;
- void Disable() override;
- void AddHostPatternToBypass(const std::string& pattern) override {}
- void AddURLPatternToBypass(const std::string& pattern) override {}
-
- // True if the proxy has been enabled, i.e., only after |Enable| has been
- // called. Defaults to false.
- bool enabled_;
-
- // Describes whether the proxy has been put in a restricted mode. True if
- // |Enable| is called with |restricted| set to true. Defaults to false.
- bool restricted_;
-
- // Describes whether the proxy has been put in a mode where the fallback
- // configuration has been disallowed. True if |Enable| is called with
- // |fallback_restricted| set to true. Defaults to false.
- bool fallback_restricted_;
-
- // The origins that are passed to |Enable|.
- std::string origin_;
- std::string fallback_origin_;
- std::string ssl_origin_;
-};
-
template <class C>
class MockDataReductionProxySettings : public C {
public:
MockDataReductionProxySettings<C>() : DataReductionProxySettings(
- new TestDataReductionProxyParams(
+ scoped_ptr<TestDataReductionProxyParams>(new TestDataReductionProxyParams(
DataReductionProxyParams::kAllowed |
DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
- ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN)) {}
+ ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN)).Pass()) {}
MockDataReductionProxySettings<C>(int flags)
- : C(new TestDataReductionProxyParams(flags,
- TestDataReductionProxyParams::HAS_EVERYTHING &
- ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
- ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN)) {}
+ : C(scoped_ptr<TestDataReductionProxyParams>(
+ new TestDataReductionProxyParams(flags,
+ TestDataReductionProxyParams::HAS_EVERYTHING &
+ ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
+ ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN))
+ .Pass()) {}
MOCK_METHOD0(GetURLFetcherForAvailabilityCheck, net::URLFetcher*());
MOCK_METHOD0(GetOriginalProfilePrefs, PrefService*());
MOCK_METHOD0(GetLocalStatePrefs, PrefService*());

Powered by Google App Engine
This is Rietveld 408576698