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_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST_UTILS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST_UTILS_H_
8 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
10 namespace data_reduction_proxy
{
12 class TestDataReductionProxyParams
: public DataReductionProxyParams
{
14 // Used to emulate having constants defined by the preprocessor.
19 HAS_FALLBACK_ORIGIN
= 0x4,
20 HAS_SSL_ORIGIN
= 0x08,
21 HAS_ALT_ORIGIN
= 0x10,
22 HAS_ALT_FALLBACK_ORIGIN
= 0x20,
24 HAS_DEV_FALLBACK_ORIGIN
= 0x80,
25 HAS_EVERYTHING
= 0xff,
28 TestDataReductionProxyParams(int flags
,
29 unsigned int has_definitions
);
30 bool init_result() const;
32 // Test values to replace the values specified in preprocessor defines.
33 static std::string
DefaultDevOrigin();
34 static std::string
DefaultDevFallbackOrigin();
35 static std::string
DefaultOrigin();
36 static std::string
DefaultFallbackOrigin();
37 static std::string
DefaultSSLOrigin();
38 static std::string
DefaultAltOrigin();
39 static std::string
DefaultAltFallbackOrigin();
40 static std::string
DefaultProbeURL();
42 static std::string
FlagOrigin();
43 static std::string
FlagFallbackOrigin();
44 static std::string
FlagSSLOrigin();
45 static std::string
FlagAltOrigin();
46 static std::string
FlagAltFallbackOrigin();
47 static std::string
FlagProbeURL();
50 virtual std::string
GetDefaultDevOrigin() const override
;
52 virtual std::string
GetDefaultDevFallbackOrigin() const override
;
54 virtual std::string
GetDefaultOrigin() const override
;
56 virtual std::string
GetDefaultFallbackOrigin() const override
;
58 virtual std::string
GetDefaultSSLOrigin() const override
;
60 virtual std::string
GetDefaultAltOrigin() const override
;
62 virtual std::string
GetDefaultAltFallbackOrigin() const override
;
64 virtual std::string
GetDefaultProbeURL() const override
;
67 std::string
GetDefinition(unsigned int has_def
,
68 const std::string
& definition
) const;
70 unsigned int has_definitions_
;
74 } // namespace data_reduction_proxy
75 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST_UTILS_H_