Index: trunk/src/components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.h |
=================================================================== |
--- trunk/src/components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.h (revision 273823) |
+++ trunk/src/components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.h (working copy) |
@@ -21,13 +21,13 @@ |
class TestDataReductionProxyConfig : public DataReductionProxyConfigurator { |
public: |
- TestDataReductionProxyConfig(); |
+ TestDataReductionProxyConfig() |
+ : enabled_(false), restricted_(false), fallback_restricted_(false) {} |
virtual ~TestDataReductionProxyConfig() {} |
virtual void Enable(bool restricted, |
bool fallback_restricted, |
const std::string& primary_origin, |
- const std::string& fallback_origin, |
- const std::string& ssl_origin) OVERRIDE; |
+ const std::string& fallback_origin) OVERRIDE; |
virtual void Disable() OVERRIDE; |
virtual void AddHostPatternToBypass(const std::string& pattern) OVERRIDE {} |
virtual void AddURLPatternToBypass(const std::string& pattern) OVERRIDE {} |
@@ -44,23 +44,11 @@ |
// 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 DataReductionProxyParams( |
- DataReductionProxyParams::kAllowed | |
- DataReductionProxyParams::kFallbackAllowed | |
- DataReductionProxyParams::kPromoAllowed)) {} |
- MockDataReductionProxySettings<C>(int flags) |
- : C(new DataReductionProxyParams(flags)) {} |
MOCK_METHOD0(GetURLFetcher, net::URLFetcher*()); |
MOCK_METHOD0(GetOriginalProfilePrefs, PrefService*()); |
MOCK_METHOD0(GetLocalStatePrefs, PrefService*()); |
@@ -72,38 +60,24 @@ |
void(ProxyStartupState state)); |
// SetProxyConfigs should always call LogProxyState exactly once. |
- virtual void SetProxyConfigs(bool enabled, |
- bool alternative_enabled, |
- bool restricted, |
- bool at_startup) OVERRIDE { |
+ virtual void SetProxyConfigs( |
+ bool enabled, bool restricted, bool at_startup) OVERRIDE { |
EXPECT_CALL(*this, LogProxyState(enabled, restricted, at_startup)).Times(1); |
- C::SetProxyConfigs(enabled, alternative_enabled, restricted, at_startup); |
+ C::SetProxyConfigs(enabled, restricted, at_startup); |
} |
}; |
class DataReductionProxySettingsTestBase : public testing::Test { |
public: |
- static void AddTestProxyToCommandLine(); |
- |
DataReductionProxySettingsTestBase(); |
- DataReductionProxySettingsTestBase(bool allowed, |
- bool fallback_allowed, |
- bool alt_allowed, |
- bool promo_allowed); |
virtual ~DataReductionProxySettingsTestBase(); |
void AddProxyToCommandLine(); |
virtual void SetUp() OVERRIDE; |
- template <class C> void ResetSettings(bool allowed, |
- bool fallback_allowed, |
- bool alt_allowed, |
- bool promo_allowed); |
- virtual void ResetSettings(bool allowed, |
- bool fallback_allowed, |
- bool alt_allowed, |
- bool promo_allowed) = 0; |
+ template <class C> void ResetSettings(); |
+ virtual void ResetSettings() = 0; |
template <class C> void SetProbeResult( |
const std::string& test_url, |
@@ -148,12 +122,8 @@ |
: public DataReductionProxySettingsTestBase { |
public: |
typedef MockDataReductionProxySettings<C> MockSettings; |
- virtual void ResetSettings(bool allowed, |
- bool fallback_allowed, |
- bool alt_allowed, |
- bool promo_allowed) OVERRIDE { |
- return DataReductionProxySettingsTestBase::ResetSettings<C>( |
- allowed, fallback_allowed, alt_allowed, promo_allowed); |
+ virtual void ResetSettings() OVERRIDE { |
+ return DataReductionProxySettingsTestBase::ResetSettings<C>(); |
} |
virtual void SetProbeResult(const std::string& test_url, |