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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.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: updated tests. 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_settings. h" 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/md5.h" 8 #include "base/md5.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 EXPECT_EQ(expected_fallback_origin.host(), proxies[1].host()); 68 EXPECT_EQ(expected_fallback_origin.host(), proxies[1].host());
69 EXPECT_EQ(expected_fallback_origin.port(), proxies[1].EffectiveIntPort()); 69 EXPECT_EQ(expected_fallback_origin.port(), proxies[1].EffectiveIntPort());
70 } 70 }
71 71
72 TEST_F(DataReductionProxySettingsTest, TestSetProxyConfigs) { 72 TEST_F(DataReductionProxySettingsTest, TestSetProxyConfigs) {
73 TestDataReductionProxyParams drp_params( 73 TestDataReductionProxyParams drp_params(
74 DataReductionProxyParams::kAllowed | 74 DataReductionProxyParams::kAllowed |
75 DataReductionProxyParams::kFallbackAllowed | 75 DataReductionProxyParams::kFallbackAllowed |
76 DataReductionProxyParams::kPromoAllowed, 76 DataReductionProxyParams::kPromoAllowed,
77 TestDataReductionProxyParams::HAS_EVERYTHING & 77 TestDataReductionProxyParams::HAS_EVERYTHING &
78 ~TestDataReductionProxyParams::HAS_DEV_ORIGIN); 78 ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
79 ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN);
79 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 80 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
80 switches::kDataReductionProxyAlt, drp_params.DefaultAltOrigin()); 81 switches::kDataReductionProxyAlt, drp_params.DefaultAltOrigin());
81 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 82 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
82 switches::kDataReductionProxyAltFallback, 83 switches::kDataReductionProxyAltFallback,
83 drp_params.DefaultAltFallbackOrigin()); 84 drp_params.DefaultAltFallbackOrigin());
84 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 85 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
85 switches::kDataReductionSSLProxy, drp_params.DefaultSSLOrigin()); 86 switches::kDataReductionSSLProxy, drp_params.DefaultSSLOrigin());
86 ResetSettings(true, true, true, true, false); 87 ResetSettings(true, true, true, true, false);
87 TestDataReductionProxyConfig* config = 88 TestDataReductionProxyConfig* config =
88 static_cast<TestDataReductionProxyConfig*>( 89 static_cast<TestDataReductionProxyConfig*>(
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 request_context.get()); 427 request_context.get());
427 settings_->SetOnDataReductionEnabledCallback( 428 settings_->SetOnDataReductionEnabledCallback(
428 base::Bind(&DataReductionProxySettingsTestBase:: 429 base::Bind(&DataReductionProxySettingsTestBase::
429 RegisterSyntheticFieldTrialCallback, 430 RegisterSyntheticFieldTrialCallback,
430 base::Unretained(this))); 431 base::Unretained(this)));
431 432
432 base::MessageLoop::current()->RunUntilIdle(); 433 base::MessageLoop::current()->RunUntilIdle();
433 } 434 }
434 435
435 } // namespace data_reduction_proxy 436 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698