OLD | NEW |
---|---|
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_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST _UTILS_H_ | 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_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST _UTILS_H_ |
7 | 7 |
8 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | 8 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
9 | 9 |
10 namespace data_reduction_proxy { | 10 namespace data_reduction_proxy { |
11 | 11 |
12 class TestDataReductionProxyParams : public DataReductionProxyParams { | 12 class TestDataReductionProxyParams : public DataReductionProxyParams { |
13 public: | 13 public: |
14 // Used to emulate having constants defined by the preprocessor. | 14 // Used to emulate having constants defined by the preprocessor. |
15 enum HasNames { | 15 enum HasNames { |
16 HAS_NOTHING = 0x0, | 16 HAS_NOTHING = 0x0, |
17 HAS_DEV_ORIGIN = 0x1, | 17 HAS_DEV_ORIGIN = 0x1, |
18 HAS_ORIGIN = 0x2, | 18 HAS_ORIGIN = 0x2, |
19 HAS_FALLBACK_ORIGIN = 0x4, | 19 HAS_FALLBACK_ORIGIN = 0x4, |
20 HAS_SSL_ORIGIN = 0x08, | 20 HAS_SSL_ORIGIN = 0x08, |
21 HAS_ALT_ORIGIN = 0x10, | 21 HAS_ALT_ORIGIN = 0x10, |
22 HAS_ALT_FALLBACK_ORIGIN = 0x20, | 22 HAS_ALT_FALLBACK_ORIGIN = 0x20, |
23 HAS_PROBE_URL = 0x40, | 23 HAS_PROBE_URL = 0x40, |
24 HAS_DEV_FALLBACK_ORIGIN = 0x80, | |
24 HAS_EVERYTHING = 0xff, | 25 HAS_EVERYTHING = 0xff, |
25 }; | 26 }; |
26 | 27 |
27 TestDataReductionProxyParams(int flags, | 28 TestDataReductionProxyParams(int flags, |
28 unsigned int has_definitions); | 29 unsigned int has_definitions); |
29 bool init_result() const; | 30 bool init_result() const; |
30 | 31 |
31 // Test values to replace the values specified in preprocessor defines. | 32 // Test values to replace the values specified in preprocessor defines. |
32 static std::string DefaultDevOrigin(); | 33 static std::string DefaultDevOrigin(); |
34 static std::string DefaultDevFallbackOrigin(); | |
33 static std::string DefaultOrigin(); | 35 static std::string DefaultOrigin(); |
34 static std::string DefaultFallbackOrigin(); | 36 static std::string DefaultFallbackOrigin(); |
35 static std::string DefaultSSLOrigin(); | 37 static std::string DefaultSSLOrigin(); |
36 static std::string DefaultAltOrigin(); | 38 static std::string DefaultAltOrigin(); |
37 static std::string DefaultAltFallbackOrigin(); | 39 static std::string DefaultAltFallbackOrigin(); |
38 static std::string DefaultProbeURL(); | 40 static std::string DefaultProbeURL(); |
39 | 41 |
40 static std::string FlagOrigin(); | 42 static std::string FlagOrigin(); |
41 static std::string FlagFallbackOrigin(); | 43 static std::string FlagFallbackOrigin(); |
42 static std::string FlagSSLOrigin(); | 44 static std::string FlagSSLOrigin(); |
43 static std::string FlagAltOrigin(); | 45 static std::string FlagAltOrigin(); |
44 static std::string FlagAltFallbackOrigin(); | 46 static std::string FlagAltFallbackOrigin(); |
45 static std::string FlagProbeURL(); | 47 static std::string FlagProbeURL(); |
46 | 48 |
47 protected: | 49 protected: |
48 virtual std::string GetDefaultDevOrigin() const OVERRIDE; | 50 virtual std::string GetDefaultDevOrigin() const OVERRIDE; |
51 virtual std::string GetDefaultDevFallbackOrigin() const OVERRIDE; | |
bengr
2014/09/09 19:17:56
Add a blank line above
bolian
2014/09/09 20:32:51
Done.
| |
49 | 52 |
50 virtual std::string GetDefaultOrigin() const OVERRIDE; | 53 virtual std::string GetDefaultOrigin() const OVERRIDE; |
51 | 54 |
52 virtual std::string GetDefaultFallbackOrigin() const OVERRIDE; | 55 virtual std::string GetDefaultFallbackOrigin() const OVERRIDE; |
53 | 56 |
54 virtual std::string GetDefaultSSLOrigin() const OVERRIDE; | 57 virtual std::string GetDefaultSSLOrigin() const OVERRIDE; |
55 | 58 |
56 virtual std::string GetDefaultAltOrigin() const OVERRIDE; | 59 virtual std::string GetDefaultAltOrigin() const OVERRIDE; |
57 | 60 |
58 virtual std::string GetDefaultAltFallbackOrigin() const OVERRIDE; | 61 virtual std::string GetDefaultAltFallbackOrigin() const OVERRIDE; |
59 | 62 |
60 virtual std::string GetDefaultProbeURL() const OVERRIDE; | 63 virtual std::string GetDefaultProbeURL() const OVERRIDE; |
61 | 64 |
62 private: | 65 private: |
63 std::string GetDefinition(unsigned int has_def, | 66 std::string GetDefinition(unsigned int has_def, |
64 const std::string& definition) const; | 67 const std::string& definition) const; |
65 | 68 |
66 unsigned int has_definitions_; | 69 unsigned int has_definitions_; |
67 bool init_result_; | 70 bool init_result_; |
68 | 71 |
69 }; | 72 }; |
70 } // namespace data_reduction_proxy | 73 } // namespace data_reduction_proxy |
71 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_T EST_UTILS_H_ | 74 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_T EST_UTILS_H_ |
72 | 75 |
OLD | NEW |