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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.h

Issue 421653005: Adding synthetic field trial for DataReductionProxyEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newPltWithCL
Patch Set: Moving set callback out of init Created 6 years, 4 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 unified diff | Download patch
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 bool expected_restricted, 150 bool expected_restricted,
151 bool expected_fallback_restricted); 151 bool expected_fallback_restricted);
152 void CheckProbeOnIPChange(const std::string& probe_url, 152 void CheckProbeOnIPChange(const std::string& probe_url,
153 const std::string& warmup_url, 153 const std::string& warmup_url,
154 const std::string& response, 154 const std::string& response,
155 bool request_success, 155 bool request_success,
156 bool expected_enabled, 156 bool expected_enabled,
157 bool expected_fallback_restricted); 157 bool expected_fallback_restricted);
158 void CheckOnPrefChange(bool enabled, bool expected_enabled, bool managed); 158 void CheckOnPrefChange(bool enabled, bool expected_enabled, bool managed);
159 void CheckInitDataReductionProxy(bool enabled_at_startup); 159 void CheckInitDataReductionProxy(bool enabled_at_startup);
160 void RegisterSyntheticFieldTrialCallback(bool proxy_enabled) {
161 proxy_enabled_ = proxy_enabled;
162 }
160 163
161 TestingPrefServiceSimple pref_service_; 164 TestingPrefServiceSimple pref_service_;
162 scoped_ptr<DataReductionProxySettings> settings_; 165 scoped_ptr<DataReductionProxySettings> settings_;
163 scoped_ptr<TestDataReductionProxyParams> expected_params_; 166 scoped_ptr<TestDataReductionProxyParams> expected_params_;
164 base::Time last_update_time_; 167 base::Time last_update_time_;
168 bool proxy_enabled_;
165 }; 169 };
166 170
167 // Test implementations should be subclasses of an instantiation of this 171 // Test implementations should be subclasses of an instantiation of this
168 // class parameterized for whatever DataReductionProxySettings class 172 // class parameterized for whatever DataReductionProxySettings class
169 // is being tested. 173 // is being tested.
170 template <class C> 174 template <class C>
171 class ConcreteDataReductionProxySettingsTest 175 class ConcreteDataReductionProxySettingsTest
172 : public DataReductionProxySettingsTestBase { 176 : public DataReductionProxySettingsTestBase {
173 public: 177 public:
174 typedef MockDataReductionProxySettings<C> MockSettings; 178 typedef MockDataReductionProxySettings<C> MockSettings;
(...skipping 18 matching lines...) Expand all
193 response, 197 response,
194 result, 198 result,
195 success, 199 success,
196 expected_calls); 200 expected_calls);
197 } 201 }
198 }; 202 };
199 203
200 } // namespace data_reduction_proxy 204 } // namespace data_reduction_proxy
201 205
202 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS _TEST_UTILS_H_ 206 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS _TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698