OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TE
ST_UTILS_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TE
ST_UTILS_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TE
ST_UTILS_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TE
ST_UTILS_H_ |
7 | 7 |
8 | 8 |
9 #include "base/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" | 10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 bool promo_allowed); | 98 bool promo_allowed); |
99 virtual ~DataReductionProxySettingsTestBase(); | 99 virtual ~DataReductionProxySettingsTestBase(); |
100 | 100 |
101 void AddProxyToCommandLine(); | 101 void AddProxyToCommandLine(); |
102 | 102 |
103 virtual void SetUp() OVERRIDE; | 103 virtual void SetUp() OVERRIDE; |
104 | 104 |
105 template <class C> void ResetSettings(bool allowed, | 105 template <class C> void ResetSettings(bool allowed, |
106 bool fallback_allowed, | 106 bool fallback_allowed, |
107 bool alt_allowed, | 107 bool alt_allowed, |
108 bool promo_allowed); | 108 bool promo_allowed, |
| 109 bool holdback); |
109 virtual void ResetSettings(bool allowed, | 110 virtual void ResetSettings(bool allowed, |
110 bool fallback_allowed, | 111 bool fallback_allowed, |
111 bool alt_allowed, | 112 bool alt_allowed, |
112 bool promo_allowed) = 0; | 113 bool promo_allowed, |
| 114 bool holdback) = 0; |
113 | 115 |
114 template <class C> void SetProbeResult( | 116 template <class C> void SetProbeResult( |
115 const std::string& test_url, | 117 const std::string& test_url, |
116 const std::string& warmup_test_url, | 118 const std::string& warmup_test_url, |
117 const std::string& response, | 119 const std::string& response, |
118 ProbeURLFetchResult state, | 120 ProbeURLFetchResult state, |
119 bool success, | 121 bool success, |
120 int expected_calls); | 122 int expected_calls); |
121 virtual void SetProbeResult(const std::string& test_url, | 123 virtual void SetProbeResult(const std::string& test_url, |
122 const std::string& warmup_test_url, | 124 const std::string& warmup_test_url, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // class parameterized for whatever DataReductionProxySettings class | 157 // class parameterized for whatever DataReductionProxySettings class |
156 // is being tested. | 158 // is being tested. |
157 template <class C> | 159 template <class C> |
158 class ConcreteDataReductionProxySettingsTest | 160 class ConcreteDataReductionProxySettingsTest |
159 : public DataReductionProxySettingsTestBase { | 161 : public DataReductionProxySettingsTestBase { |
160 public: | 162 public: |
161 typedef MockDataReductionProxySettings<C> MockSettings; | 163 typedef MockDataReductionProxySettings<C> MockSettings; |
162 virtual void ResetSettings(bool allowed, | 164 virtual void ResetSettings(bool allowed, |
163 bool fallback_allowed, | 165 bool fallback_allowed, |
164 bool alt_allowed, | 166 bool alt_allowed, |
165 bool promo_allowed) OVERRIDE { | 167 bool promo_allowed, |
| 168 bool holdback) OVERRIDE { |
166 return DataReductionProxySettingsTestBase::ResetSettings<C>( | 169 return DataReductionProxySettingsTestBase::ResetSettings<C>( |
167 allowed, fallback_allowed, alt_allowed, promo_allowed); | 170 allowed, fallback_allowed, alt_allowed, promo_allowed, holdback); |
168 } | 171 } |
169 | 172 |
170 virtual void SetProbeResult(const std::string& test_url, | 173 virtual void SetProbeResult(const std::string& test_url, |
171 const std::string& warmup_test_url, | 174 const std::string& warmup_test_url, |
172 const std::string& response, | 175 const std::string& response, |
173 ProbeURLFetchResult result, | 176 ProbeURLFetchResult result, |
174 bool success, | 177 bool success, |
175 int expected_calls) OVERRIDE { | 178 int expected_calls) OVERRIDE { |
176 return DataReductionProxySettingsTestBase::SetProbeResult<C>( | 179 return DataReductionProxySettingsTestBase::SetProbeResult<C>( |
177 test_url, | 180 test_url, |
178 warmup_test_url, | 181 warmup_test_url, |
179 response, | 182 response, |
180 result, | 183 result, |
181 success, | 184 success, |
182 expected_calls); | 185 expected_calls); |
183 } | 186 } |
184 }; | 187 }; |
185 | 188 |
186 } // namespace data_reduction_proxy | 189 } // namespace data_reduction_proxy |
187 | 190 |
188 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_TEST_UTILS_H_ | 191 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_TEST_UTILS_H_ |
OLD | NEW |