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

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

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 8 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_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_TEST_UTILS_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_TEST_UTILS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_TEST_UTILS_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_TEST_UTILS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void InitWithStatisticsPrefs(); 76 void InitWithStatisticsPrefs();
77 void InitDataReductionProxy(bool enabled_at_startup); 77 void InitDataReductionProxy(bool enabled_at_startup);
78 void CheckDataReductionProxySyntheticTrial(bool enabled); 78 void CheckDataReductionProxySyntheticTrial(bool enabled);
79 void CheckDataReductionProxyLoFiSyntheticTrial(bool enabled); 79 void CheckDataReductionProxyLoFiSyntheticTrial(bool enabled);
80 bool SyntheticFieldTrialRegistrationCallback(const std::string& trial_name, 80 bool SyntheticFieldTrialRegistrationCallback(const std::string& trial_name,
81 const std::string& group_name) { 81 const std::string& group_name) {
82 synthetic_field_trials_[trial_name] = group_name; 82 synthetic_field_trials_[trial_name] = group_name;
83 return true; 83 return true;
84 } 84 }
85 85
86 base::MessageLoopForIO message_loop_;
86 scoped_ptr<DataReductionProxyTestContext> test_context_; 87 scoped_ptr<DataReductionProxyTestContext> test_context_;
87 scoped_ptr<DataReductionProxySettings> settings_; 88 scoped_ptr<DataReductionProxySettings> settings_;
88 base::Time last_update_time_; 89 base::Time last_update_time_;
89 std::map<std::string, std::string> synthetic_field_trials_; 90 std::map<std::string, std::string> synthetic_field_trials_;
90 }; 91 };
91 92
92 // Test implementations should be subclasses of an instantiation of this 93 // Test implementations should be subclasses of an instantiation of this
93 // class parameterized for whatever DataReductionProxySettings class 94 // class parameterized for whatever DataReductionProxySettings class
94 // is being tested. 95 // is being tested.
95 template <class C> 96 template <class C>
96 class ConcreteDataReductionProxySettingsTest 97 class ConcreteDataReductionProxySettingsTest
97 : public DataReductionProxySettingsTestBase { 98 : public DataReductionProxySettingsTestBase {
98 public: 99 public:
99 typedef MockDataReductionProxySettings<C> MockSettings; 100 typedef MockDataReductionProxySettings<C> MockSettings;
100 virtual void ResetSettings(bool allowed, 101 virtual void ResetSettings(bool allowed,
101 bool fallback_allowed, 102 bool fallback_allowed,
102 bool alt_allowed, 103 bool alt_allowed,
103 bool promo_allowed, 104 bool promo_allowed,
104 bool holdback) override { 105 bool holdback) override {
105 return DataReductionProxySettingsTestBase::ResetSettings<C>( 106 return DataReductionProxySettingsTestBase::ResetSettings<C>(
106 allowed, fallback_allowed, alt_allowed, promo_allowed, holdback); 107 allowed, fallback_allowed, alt_allowed, promo_allowed, holdback);
107 } 108 }
108 }; 109 };
109 110
110 } // namespace data_reduction_proxy 111 } // namespace data_reduction_proxy
111 112
112 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SET TINGS_TEST_UTILS_H_ 113 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SET TINGS_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698