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

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

Issue 2922663002: Data Reduction Proxy: Remove duplicate functions (Closed)
Patch Set: megjablon comments Created 3 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_CONFIG _TEST_UTILS_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG _TEST_UTILS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG _TEST_UTILS_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG _TEST_UTILS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 22 matching lines...) Expand all
33 class DataReductionProxyEventCreator; 33 class DataReductionProxyEventCreator;
34 class DataReductionProxyMutableConfigValues; 34 class DataReductionProxyMutableConfigValues;
35 class TestDataReductionProxyParams; 35 class TestDataReductionProxyParams;
36 36
37 // Test version of |DataReductionProxyConfig|, which uses an underlying 37 // Test version of |DataReductionProxyConfig|, which uses an underlying
38 // |TestDataReductionProxyParams| to permit overriding of default values 38 // |TestDataReductionProxyParams| to permit overriding of default values
39 // returning from |DataReductionProxyParams|, as well as exposing methods to 39 // returning from |DataReductionProxyParams|, as well as exposing methods to
40 // change the underlying state. 40 // change the underlying state.
41 class TestDataReductionProxyConfig : public DataReductionProxyConfig { 41 class TestDataReductionProxyConfig : public DataReductionProxyConfig {
42 public: 42 public:
43 // Creates a |TestDataReductionProxyConfig| with the provided |params_flags|.
44 TestDataReductionProxyConfig( 43 TestDataReductionProxyConfig(
45 int params_flags,
46 unsigned int params_definitions,
47 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 44 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
48 net::NetLog* net_log, 45 net::NetLog* net_log,
49 DataReductionProxyConfigurator* configurator, 46 DataReductionProxyConfigurator* configurator,
50 DataReductionProxyEventCreator* event_creator); 47 DataReductionProxyEventCreator* event_creator);
51 48
52 // Creates a |TestDataReductionProxyConfig| with the provided |config_values|. 49 // Creates a |TestDataReductionProxyConfig| with the provided |config_values|.
53 // This permits any DataReductionProxyConfigValues to be used (such as 50 // This permits any DataReductionProxyConfigValues to be used (such as
54 // DataReductionProxyParams or DataReductionProxyMutableConfigValues). 51 // DataReductionProxyParams or DataReductionProxyMutableConfigValues).
55 TestDataReductionProxyConfig( 52 TestDataReductionProxyConfig(
56 std::unique_ptr<DataReductionProxyConfigValues> config_values, 53 std::unique_ptr<DataReductionProxyConfigValues> config_values,
57 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 54 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
58 net::NetLog* net_log, 55 net::NetLog* net_log,
59 DataReductionProxyConfigurator* configurator, 56 DataReductionProxyConfigurator* configurator,
60 DataReductionProxyEventCreator* event_creator); 57 DataReductionProxyEventCreator* event_creator);
61 58
62 ~TestDataReductionProxyConfig() override; 59 ~TestDataReductionProxyConfig() override;
63 60
64 void GetNetworkList(net::NetworkInterfaceList* interfaces, 61 void GetNetworkList(net::NetworkInterfaceList* interfaces,
65 int policy) override; 62 int policy) override;
66 63
67 // Allows tests to reset the params being used for configuration. 64 // Allows tests to reset the params being used for configuration.
68 void ResetParamFlagsForTest(int flags); 65 void ResetParamFlagsForTest();
69 66
70 // Retrieves the test params being used for the configuration. 67 // Retrieves the test params being used for the configuration.
71 TestDataReductionProxyParams* test_params(); 68 TestDataReductionProxyParams* test_params();
72 69
73 // Retrieves the underlying config values. 70 // Retrieves the underlying config values.
74 // TODO(jeremyim): Rationalize with test_params(). 71 // TODO(jeremyim): Rationalize with test_params().
75 DataReductionProxyConfigValues* config_values(); 72 DataReductionProxyConfigValues* config_values();
76 73
77 // Resets the Lo-Fi status to default state. 74 // Resets the Lo-Fi status to default state.
78 void ResetLoFiStatusForTest(); 75 void ResetLoFiStatusForTest();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 183
187 using DataReductionProxyConfig::UpdateConfigForTesting; 184 using DataReductionProxyConfig::UpdateConfigForTesting;
188 185
189 // Resets the Lo-Fi status to default state. 186 // Resets the Lo-Fi status to default state.
190 void ResetLoFiStatusForTest(); 187 void ResetLoFiStatusForTest();
191 }; 188 };
192 189
193 } // namespace data_reduction_proxy 190 } // namespace data_reduction_proxy
194 191
195 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CON FIG_TEST_UTILS_H_ 192 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CON FIG_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698