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

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

Issue 903213003: Enable QUIC for proxies based on Finch config and command line switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments and removed code duplication. Created 5 years, 10 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/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 CheckParams(params, true, true, true, false, true); 74 CheckParams(params, true, true, true, false, true);
75 CheckValues(params, 75 CheckValues(params,
76 TestDataReductionProxyParams::DefaultOrigin(), 76 TestDataReductionProxyParams::DefaultOrigin(),
77 TestDataReductionProxyParams::DefaultFallbackOrigin(), 77 TestDataReductionProxyParams::DefaultFallbackOrigin(),
78 TestDataReductionProxyParams::DefaultSSLOrigin(), 78 TestDataReductionProxyParams::DefaultSSLOrigin(),
79 TestDataReductionProxyParams::DefaultAltOrigin(), 79 TestDataReductionProxyParams::DefaultAltOrigin(),
80 TestDataReductionProxyParams::DefaultAltFallbackOrigin(), 80 TestDataReductionProxyParams::DefaultAltFallbackOrigin(),
81 TestDataReductionProxyParams::DefaultProbeURL()); 81 TestDataReductionProxyParams::DefaultProbeURL());
82 } 82 }
83 83
84 TEST_F(DataReductionProxyParamsTest, QuicEnabled) {
85 TestDataReductionProxyParams params(
86 DataReductionProxyParams::kAllowed |
87 DataReductionProxyParams::kFallbackAllowed |
88 DataReductionProxyParams::kPromoAllowed,
89 TestDataReductionProxyParams::HAS_EVERYTHING &
90 ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
91 ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN);
92
93 CheckParams(params, true, true, true, false, true);
94 CheckValues(params,
95 TestDataReductionProxyParams::DefaultOrigin(),
96 TestDataReductionProxyParams::DefaultFallbackOrigin(),
97 TestDataReductionProxyParams::DefaultSSLOrigin(),
98 TestDataReductionProxyParams::DefaultAltOrigin(),
99 TestDataReductionProxyParams::DefaultAltFallbackOrigin(),
100 TestDataReductionProxyParams::DefaultProbeURL());
101 }
102
84 TEST_F(DataReductionProxyParamsTest, Flags) { 103 TEST_F(DataReductionProxyParamsTest, Flags) {
85 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 104 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
86 switches::kDataReductionProxy, 105 switches::kDataReductionProxy,
87 TestDataReductionProxyParams::FlagOrigin()); 106 TestDataReductionProxyParams::FlagOrigin());
88 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 107 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
89 switches::kDataReductionProxyFallback, 108 switches::kDataReductionProxyFallback,
90 TestDataReductionProxyParams::FlagFallbackOrigin()); 109 TestDataReductionProxyParams::FlagFallbackOrigin());
91 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 110 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
92 switches::kDataReductionSSLProxy, 111 switches::kDataReductionSSLProxy,
93 TestDataReductionProxyParams::FlagSSLOrigin()); 112 TestDataReductionProxyParams::FlagSSLOrigin());
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 } 1247 }
1229 1248
1230 TEST_F(DataReductionProxyParamsTest, AndroidOnePromoFieldTrial) { 1249 TEST_F(DataReductionProxyParamsTest, AndroidOnePromoFieldTrial) {
1231 EXPECT_TRUE(DataReductionProxyParams::IsIncludedInAndroidOnePromoFieldTrial( 1250 EXPECT_TRUE(DataReductionProxyParams::IsIncludedInAndroidOnePromoFieldTrial(
1232 "google/sprout/sprout:4.4.4/KPW53/1379542:user/release-keys")); 1251 "google/sprout/sprout:4.4.4/KPW53/1379542:user/release-keys"));
1233 EXPECT_FALSE(DataReductionProxyParams::IsIncludedInAndroidOnePromoFieldTrial( 1252 EXPECT_FALSE(DataReductionProxyParams::IsIncludedInAndroidOnePromoFieldTrial(
1234 "google/hammerhead/hammerhead:5.0/LRX210/1570415:user/release-keys")); 1253 "google/hammerhead/hammerhead:5.0/LRX210/1570415:user/release-keys"));
1235 } 1254 }
1236 1255
1237 } // namespace data_reduction_proxy 1256 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698