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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 bool promo_allowed); | 109 bool promo_allowed); |
110 virtual ~DataReductionProxySettingsTestBase(); | 110 virtual ~DataReductionProxySettingsTestBase(); |
111 | 111 |
112 void AddProxyToCommandLine(); | 112 void AddProxyToCommandLine(); |
113 | 113 |
114 virtual void SetUp() OVERRIDE; | 114 virtual void SetUp() OVERRIDE; |
115 | 115 |
116 template <class C> void ResetSettings(bool allowed, | 116 template <class C> void ResetSettings(bool allowed, |
117 bool fallback_allowed, | 117 bool fallback_allowed, |
118 bool alt_allowed, | 118 bool alt_allowed, |
119 bool promo_allowed); | 119 bool promo_allowed, |
| 120 bool holdback); |
120 virtual void ResetSettings(bool allowed, | 121 virtual void ResetSettings(bool allowed, |
121 bool fallback_allowed, | 122 bool fallback_allowed, |
122 bool alt_allowed, | 123 bool alt_allowed, |
123 bool promo_allowed) = 0; | 124 bool promo_allowed, |
| 125 bool holdback) = 0; |
124 | 126 |
125 template <class C> void SetProbeResult( | 127 template <class C> void SetProbeResult( |
126 const std::string& test_url, | 128 const std::string& test_url, |
127 const std::string& warmup_test_url, | 129 const std::string& warmup_test_url, |
128 const std::string& response, | 130 const std::string& response, |
129 ProbeURLFetchResult state, | 131 ProbeURLFetchResult state, |
130 bool success, | 132 bool success, |
131 int expected_calls); | 133 int expected_calls); |
132 virtual void SetProbeResult(const std::string& test_url, | 134 virtual void SetProbeResult(const std::string& test_url, |
133 const std::string& warmup_test_url, | 135 const std::string& warmup_test_url, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // class parameterized for whatever DataReductionProxySettings class | 168 // class parameterized for whatever DataReductionProxySettings class |
167 // is being tested. | 169 // is being tested. |
168 template <class C> | 170 template <class C> |
169 class ConcreteDataReductionProxySettingsTest | 171 class ConcreteDataReductionProxySettingsTest |
170 : public DataReductionProxySettingsTestBase { | 172 : public DataReductionProxySettingsTestBase { |
171 public: | 173 public: |
172 typedef MockDataReductionProxySettings<C> MockSettings; | 174 typedef MockDataReductionProxySettings<C> MockSettings; |
173 virtual void ResetSettings(bool allowed, | 175 virtual void ResetSettings(bool allowed, |
174 bool fallback_allowed, | 176 bool fallback_allowed, |
175 bool alt_allowed, | 177 bool alt_allowed, |
176 bool promo_allowed) OVERRIDE { | 178 bool promo_allowed, |
| 179 bool holdback) OVERRIDE { |
177 return DataReductionProxySettingsTestBase::ResetSettings<C>( | 180 return DataReductionProxySettingsTestBase::ResetSettings<C>( |
178 allowed, fallback_allowed, alt_allowed, promo_allowed); | 181 allowed, fallback_allowed, alt_allowed, promo_allowed, holdback); |
179 } | 182 } |
180 | 183 |
181 virtual void SetProbeResult(const std::string& test_url, | 184 virtual void SetProbeResult(const std::string& test_url, |
182 const std::string& warmup_test_url, | 185 const std::string& warmup_test_url, |
183 const std::string& response, | 186 const std::string& response, |
184 ProbeURLFetchResult result, | 187 ProbeURLFetchResult result, |
185 bool success, | 188 bool success, |
186 int expected_calls) OVERRIDE { | 189 int expected_calls) OVERRIDE { |
187 return DataReductionProxySettingsTestBase::SetProbeResult<C>( | 190 return DataReductionProxySettingsTestBase::SetProbeResult<C>( |
188 test_url, | 191 test_url, |
189 warmup_test_url, | 192 warmup_test_url, |
190 response, | 193 response, |
191 result, | 194 result, |
192 success, | 195 success, |
193 expected_calls); | 196 expected_calls); |
194 } | 197 } |
195 }; | 198 }; |
196 | 199 |
197 } // namespace data_reduction_proxy | 200 } // namespace data_reduction_proxy |
198 | 201 |
199 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_TEST_UTILS_H_ | 202 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_TEST_UTILS_H_ |
OLD | NEW |