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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST_UTILS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST_UTILS_H_
10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
22 namespace data_reduction_proxy
{
24 class TestDataReductionProxyParams
: public DataReductionProxyParams
{
26 // Used to emulate having constants defined by the preprocessor.
31 HAS_FALLBACK_ORIGIN
= 0x4,
32 HAS_SSL_ORIGIN
= 0x08,
33 HAS_SECURE_PROXY_CHECK_URL
= 0x40,
34 HAS_DEV_FALLBACK_ORIGIN
= 0x80,
35 HAS_EVERYTHING
= 0xff,
38 TestDataReductionProxyParams(int flags
,
39 unsigned int has_definitions
);
40 bool init_result() const;
42 void SetProxiesForHttp(const std::vector
<net::ProxyServer
>& proxies
);
44 // Test values to replace the values specified in preprocessor defines.
45 static std::string
DefaultDevOrigin();
46 static std::string
DefaultDevFallbackOrigin();
47 static std::string
DefaultOrigin();
48 static std::string
DefaultFallbackOrigin();
49 static std::string
DefaultSSLOrigin();
50 static std::string
DefaultSecureProxyCheckURL();
52 static std::string
FlagOrigin();
53 static std::string
FlagFallbackOrigin();
54 static std::string
FlagSSLOrigin();
55 static std::string
FlagSecureProxyCheckURL();
58 std::string
GetDefaultDevOrigin() const override
;
60 std::string
GetDefaultDevFallbackOrigin() const override
;
62 std::string
GetDefaultOrigin() const override
;
64 std::string
GetDefaultFallbackOrigin() const override
;
66 std::string
GetDefaultSSLOrigin() const override
;
68 std::string
GetDefaultSecureProxyCheckURL() const override
;
71 std::string
GetDefinition(unsigned int has_def
,
72 const std::string
& definition
) const;
74 unsigned int has_definitions_
;
77 } // namespace data_reduction_proxy
78 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST_UTILS_H_