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

Side by Side Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc

Issue 762723003: Prefix CommandLine usage with base namespace (Part 8: components) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/core/common/data_reduction_proxy_param s.h" 5 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 CheckValues(params, 74 CheckValues(params,
75 TestDataReductionProxyParams::DefaultOrigin(), 75 TestDataReductionProxyParams::DefaultOrigin(),
76 TestDataReductionProxyParams::DefaultFallbackOrigin(), 76 TestDataReductionProxyParams::DefaultFallbackOrigin(),
77 TestDataReductionProxyParams::DefaultSSLOrigin(), 77 TestDataReductionProxyParams::DefaultSSLOrigin(),
78 TestDataReductionProxyParams::DefaultAltOrigin(), 78 TestDataReductionProxyParams::DefaultAltOrigin(),
79 TestDataReductionProxyParams::DefaultAltFallbackOrigin(), 79 TestDataReductionProxyParams::DefaultAltFallbackOrigin(),
80 TestDataReductionProxyParams::DefaultProbeURL()); 80 TestDataReductionProxyParams::DefaultProbeURL());
81 } 81 }
82 82
83 TEST_F(DataReductionProxyParamsTest, Flags) { 83 TEST_F(DataReductionProxyParamsTest, Flags) {
84 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 84 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
85 switches::kDataReductionProxy, 85 switches::kDataReductionProxy,
86 TestDataReductionProxyParams::FlagOrigin()); 86 TestDataReductionProxyParams::FlagOrigin());
87 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 87 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
88 switches::kDataReductionProxyFallback, 88 switches::kDataReductionProxyFallback,
89 TestDataReductionProxyParams::FlagFallbackOrigin()); 89 TestDataReductionProxyParams::FlagFallbackOrigin());
90 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 90 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
91 switches::kDataReductionSSLProxy, 91 switches::kDataReductionSSLProxy,
92 TestDataReductionProxyParams::FlagSSLOrigin()); 92 TestDataReductionProxyParams::FlagSSLOrigin());
93 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 93 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
94 switches::kDataReductionProxyAlt, 94 switches::kDataReductionProxyAlt,
95 TestDataReductionProxyParams::FlagAltOrigin()); 95 TestDataReductionProxyParams::FlagAltOrigin());
96 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 96 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
97 switches::kDataReductionProxyAltFallback, 97 switches::kDataReductionProxyAltFallback,
98 TestDataReductionProxyParams::FlagAltFallbackOrigin()); 98 TestDataReductionProxyParams::FlagAltFallbackOrigin());
99 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 99 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
100 switches::kDataReductionProxyProbeURL, 100 switches::kDataReductionProxyProbeURL,
101 TestDataReductionProxyParams::FlagProbeURL()); 101 TestDataReductionProxyParams::FlagProbeURL());
102 TestDataReductionProxyParams params( 102 TestDataReductionProxyParams params(
103 DataReductionProxyParams::kAllowed | 103 DataReductionProxyParams::kAllowed |
104 DataReductionProxyParams::kFallbackAllowed | 104 DataReductionProxyParams::kFallbackAllowed |
105 DataReductionProxyParams::kAlternativeAllowed | 105 DataReductionProxyParams::kAlternativeAllowed |
106 DataReductionProxyParams::kPromoAllowed, 106 DataReductionProxyParams::kPromoAllowed,
107 TestDataReductionProxyParams::HAS_EVERYTHING); 107 TestDataReductionProxyParams::HAS_EVERYTHING);
108 CheckParams(params, true, true, true, true, true); 108 CheckParams(params, true, true, true, true, true);
109 CheckValues(params, 109 CheckValues(params,
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 base::TimeDelta min_retry_delay; 1187 base::TimeDelta min_retry_delay;
1188 was_bypassed = params.AreProxiesBypassed(retry_map, 1188 was_bypassed = params.AreProxiesBypassed(retry_map,
1189 rules, 1189 rules,
1190 false, 1190 false,
1191 &min_retry_delay); 1191 &min_retry_delay);
1192 EXPECT_TRUE(was_bypassed); 1192 EXPECT_TRUE(was_bypassed);
1193 EXPECT_EQ(delay, min_retry_delay); 1193 EXPECT_EQ(delay, min_retry_delay);
1194 } 1194 }
1195 1195
1196 } // namespace data_reduction_proxy 1196 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698