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

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_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_TEST_U TILS_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_TEST_U TILS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_TEST_U TILS_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_TEST_U TILS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 class DataReductionProxyTestContext { 275 class DataReductionProxyTestContext {
276 public: 276 public:
277 // Allows for a fluent builder interface to configure what kind of objects 277 // Allows for a fluent builder interface to configure what kind of objects
278 // (test vs mock vs real) are used by the |DataReductionProxyTestContext|. 278 // (test vs mock vs real) are used by the |DataReductionProxyTestContext|.
279 class Builder { 279 class Builder {
280 public: 280 public:
281 Builder(); 281 Builder();
282 282
283 ~Builder(); 283 ~Builder();
284 284
285 // |DataReductionProxyParams| flags to use.
286 Builder& WithParamsFlags(int params_flags);
287
288 // |TestDataReductionProxyParams| flags to use.
289 Builder& WithParamsDefinitions(unsigned int params_definitions);
290
291 // The |Client| enum to use for |DataReductionProxyRequestOptions|. 285 // The |Client| enum to use for |DataReductionProxyRequestOptions|.
292 Builder& WithClient(Client client); 286 Builder& WithClient(Client client);
293 287
294 // Specifies a |net::URLRequestContext| to use. The |request_context| is 288 // Specifies a |net::URLRequestContext| to use. The |request_context| is
295 // owned by the caller. 289 // owned by the caller.
296 Builder& WithURLRequestContext(net::URLRequestContext* request_context); 290 Builder& WithURLRequestContext(net::URLRequestContext* request_context);
297 291
298 // Specifies a |net::MockClientSocketFactory| to use. The 292 // Specifies a |net::MockClientSocketFactory| to use. The
299 // |mock_socket_factory| is owned by the caller. If a non-NULL 293 // |mock_socket_factory| is owned by the caller. If a non-NULL
300 // |request_context_| is also specified, then the caller is responsible for 294 // |request_context_| is also specified, then the caller is responsible for
(...skipping 26 matching lines...) Expand all
327 Builder& SkipSettingsInitialization(); 321 Builder& SkipSettingsInitialization();
328 322
329 // Specifies the data reduction proxy servers. 323 // Specifies the data reduction proxy servers.
330 Builder& WithProxiesForHttp( 324 Builder& WithProxiesForHttp(
331 const std::vector<DataReductionProxyServer>& proxy_servers); 325 const std::vector<DataReductionProxyServer>& proxy_servers);
332 326
333 // Creates a |DataReductionProxyTestContext|. Owned by the caller. 327 // Creates a |DataReductionProxyTestContext|. Owned by the caller.
334 std::unique_ptr<DataReductionProxyTestContext> Build(); 328 std::unique_ptr<DataReductionProxyTestContext> Build();
335 329
336 private: 330 private:
337 int params_flags_;
338 unsigned int params_definitions_;
339 Client client_; 331 Client client_;
340 net::URLRequestContext* request_context_; 332 net::URLRequestContext* request_context_;
341 net::MockClientSocketFactory* mock_socket_factory_; 333 net::MockClientSocketFactory* mock_socket_factory_;
342 334
343 bool use_mock_config_; 335 bool use_mock_config_;
344 bool use_mock_service_; 336 bool use_mock_service_;
345 bool use_mock_request_options_; 337 bool use_mock_request_options_;
346 bool use_config_client_; 338 bool use_config_client_;
347 bool use_test_config_client_; 339 bool use_test_config_client_;
348 bool skip_settings_initialization_; 340 bool skip_settings_initialization_;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 std::unique_ptr<TestConfigStorer> config_storer_; 524 std::unique_ptr<TestConfigStorer> config_storer_;
533 525
534 TestDataReductionProxyParams* params_; 526 TestDataReductionProxyParams* params_;
535 527
536 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyTestContext); 528 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyTestContext);
537 }; 529 };
538 530
539 } // namespace data_reduction_proxy 531 } // namespace data_reduction_proxy
540 532
541 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_TES T_UTILS_H_ 533 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_TES T_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698