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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_params_test_utils.cc

Issue 549153003: Dev finch trial of the data reduction proxy overrides both the primary and the fallback hosts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments. Created 6 years, 3 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 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 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params_te st_utils.h" 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params_te st_utils.h"
6 6
7 namespace { 7 namespace {
8 // Test values to replace the values specified in preprocessor defines. 8 // Test values to replace the values specified in preprocessor defines.
9 static const char kDefaultDevOrigin[] = "https://dev.net:443/"; 9 static const char kDefaultDevOrigin[] = "https://dev.net:443/";
10 static const char kDefaultDevFallbackOrigin[] = "http://dev.net:80/";
10 static const char kDefaultOrigin[] = "https://origin.net:443/"; 11 static const char kDefaultOrigin[] = "https://origin.net:443/";
11 static const char kDefaultFallbackOrigin[] = "http://fallback.net:80/"; 12 static const char kDefaultFallbackOrigin[] = "http://fallback.net:80/";
12 static const char kDefaultSSLOrigin[] = "http://ssl.net:1080/"; 13 static const char kDefaultSSLOrigin[] = "http://ssl.net:1080/";
13 static const char kDefaultAltOrigin[] = "https://alt.net:443/"; 14 static const char kDefaultAltOrigin[] = "https://alt.net:443/";
14 static const char kDefaultAltFallbackOrigin[] = "http://altfallback.net:80/"; 15 static const char kDefaultAltFallbackOrigin[] = "http://altfallback.net:80/";
15 static const char kDefaultProbeURL[] = "http://probe.net/"; 16 static const char kDefaultProbeURL[] = "http://probe.net/";
16 17
17 static const char kFlagOrigin[] = "https://origin.org:443/"; 18 static const char kFlagOrigin[] = "https://origin.org:443/";
18 static const char kFlagFallbackOrigin[] = "http://fallback.org:80/"; 19 static const char kFlagFallbackOrigin[] = "http://fallback.org:80/";
19 static const char kFlagSSLOrigin[] = "http://ssl.org:1080/"; 20 static const char kFlagSSLOrigin[] = "http://ssl.org:1080/";
(...skipping 14 matching lines...) Expand all
34 35
35 bool TestDataReductionProxyParams::init_result() const { 36 bool TestDataReductionProxyParams::init_result() const {
36 return init_result_; 37 return init_result_;
37 } 38 }
38 39
39 // Test values to replace the values specified in preprocessor defines. 40 // Test values to replace the values specified in preprocessor defines.
40 std::string TestDataReductionProxyParams::DefaultDevOrigin() { 41 std::string TestDataReductionProxyParams::DefaultDevOrigin() {
41 return kDefaultDevOrigin; 42 return kDefaultDevOrigin;
42 } 43 }
43 44
45 std::string TestDataReductionProxyParams::DefaultDevFallbackOrigin() {
46 return kDefaultDevFallbackOrigin;
47 }
48
44 std::string TestDataReductionProxyParams::DefaultOrigin() { 49 std::string TestDataReductionProxyParams::DefaultOrigin() {
45 return kDefaultOrigin; 50 return kDefaultOrigin;
46 } 51 }
47 52
48 std::string TestDataReductionProxyParams::DefaultFallbackOrigin() { 53 std::string TestDataReductionProxyParams::DefaultFallbackOrigin() {
49 return kDefaultFallbackOrigin; 54 return kDefaultFallbackOrigin;
50 } 55 }
51 56
52 std::string TestDataReductionProxyParams::DefaultSSLOrigin() { 57 std::string TestDataReductionProxyParams::DefaultSSLOrigin() {
53 return kDefaultSSLOrigin; 58 return kDefaultSSLOrigin;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 92
88 std::string TestDataReductionProxyParams::FlagProbeURL() { 93 std::string TestDataReductionProxyParams::FlagProbeURL() {
89 return kFlagProbeURL; 94 return kFlagProbeURL;
90 } 95 }
91 96
92 std::string TestDataReductionProxyParams::GetDefaultDevOrigin() const { 97 std::string TestDataReductionProxyParams::GetDefaultDevOrigin() const {
93 return GetDefinition( 98 return GetDefinition(
94 TestDataReductionProxyParams::HAS_DEV_ORIGIN, kDefaultDevOrigin); 99 TestDataReductionProxyParams::HAS_DEV_ORIGIN, kDefaultDevOrigin);
95 } 100 }
96 101
102 std::string TestDataReductionProxyParams::GetDefaultDevFallbackOrigin() const {
103 return GetDefinition(
104 TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
105 kDefaultDevFallbackOrigin);
106 }
107
97 std::string TestDataReductionProxyParams::GetDefaultOrigin() const { 108 std::string TestDataReductionProxyParams::GetDefaultOrigin() const {
98 return GetDefinition( 109 return GetDefinition(
99 TestDataReductionProxyParams::HAS_ORIGIN, kDefaultOrigin); 110 TestDataReductionProxyParams::HAS_ORIGIN, kDefaultOrigin);
100 } 111 }
101 112
102 std::string TestDataReductionProxyParams::GetDefaultFallbackOrigin() const { 113 std::string TestDataReductionProxyParams::GetDefaultFallbackOrigin() const {
103 return GetDefinition( 114 return GetDefinition(
104 TestDataReductionProxyParams::HAS_FALLBACK_ORIGIN, 115 TestDataReductionProxyParams::HAS_FALLBACK_ORIGIN,
105 kDefaultFallbackOrigin); 116 kDefaultFallbackOrigin);
106 } 117 }
(...skipping 18 matching lines...) Expand all
125 return GetDefinition( 136 return GetDefinition(
126 TestDataReductionProxyParams::HAS_PROBE_URL, kDefaultProbeURL); 137 TestDataReductionProxyParams::HAS_PROBE_URL, kDefaultProbeURL);
127 } 138 }
128 139
129 std::string TestDataReductionProxyParams::GetDefinition( 140 std::string TestDataReductionProxyParams::GetDefinition(
130 unsigned int has_def, 141 unsigned int has_def,
131 const std::string& definition) const { 142 const std::string& definition) const {
132 return ((has_definitions_ & has_def) ? definition : std::string()); 143 return ((has_definitions_ & has_def) ? definition : std::string());
133 } 144 }
134 } // namespace data_reduction_proxy 145 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698