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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc

Issue 1547273003: Set trusted SPDY proxy dynamically on per-profile basis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated based on design doc discussion Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc
index d0b03d75b1c6caa6464c921e0e08567160406453..ad47bec206d46ccabba653904112b69dba36d73f 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc
@@ -219,6 +219,8 @@ class DataReductionProxyConfigServiceClientTest : public testing::Test {
return test_context_->test_configurator();
}
+ TestDataReductionProxyConfig* config() { return test_context_->config(); }
+
MockDataReductionProxyRequestOptions* request_options() {
return test_context_->mock_request_options();
}
@@ -311,18 +313,21 @@ TEST_F(DataReductionProxyConfigServiceClientTest, DevRolloutAndQuic) {
const struct {
bool enable_dev;
bool enable_quic;
+ bool enable_trusted_spdy_proxy_field_trial;
std::string expected_primary_proxy;
std::string expected_fallback_proxy;
net::ProxyServer::Scheme expected_primary_proxy_scheme;
} tests[] = {
- {false, false, kSuccessOrigin, kSuccessFallback,
+ {false, false, false, kSuccessOrigin, kSuccessFallback,
+ net::ProxyServer::SCHEME_HTTPS},
+ {false, false, true, kSuccessOrigin, kSuccessFallback,
net::ProxyServer::SCHEME_HTTPS},
- {false, true, kSuccessOrigin, kSuccessFallback,
+ {false, true, true, kSuccessOrigin, kSuccessFallback,
net::ProxyServer::SCHEME_QUIC},
- {true, false, TestDataReductionProxyParams::DefaultDevOrigin(),
+ {true, false, true, TestDataReductionProxyParams::DefaultDevOrigin(),
TestDataReductionProxyParams::DefaultDevFallbackOrigin(),
net::ProxyServer::SCHEME_HTTPS},
- {true, true, TestDataReductionProxyParams::DefaultDevOrigin(),
+ {true, true, true, TestDataReductionProxyParams::DefaultDevOrigin(),
TestDataReductionProxyParams::DefaultDevFallbackOrigin(),
net::ProxyServer::SCHEME_QUIC},
};
@@ -335,6 +340,13 @@ TEST_F(DataReductionProxyConfigServiceClientTest, DevRolloutAndQuic) {
}
base::FieldTrialList field_trial_list(new base::MockEntropyProvider());
+ if (tests[i].enable_trusted_spdy_proxy_field_trial) {
+ base::FieldTrialList::CreateFieldTrial(
+ params::GetTrustedSpdyProxyFieldTrialName(), "Enabled");
+ } else {
+ base::FieldTrialList::CreateFieldTrial(
bengr 2016/01/26 19:39:55 How about this? base::FieldTrialList::CreateField
tbansal1 2016/01/27 00:13:33 Done.
+ params::GetTrustedSpdyProxyFieldTrialName(), "Control");
+ }
if (tests[i].enable_quic) {
base::FieldTrialList::CreateFieldTrial(params::GetQuicFieldTrialName(),
"Enabled");
@@ -372,6 +384,18 @@ TEST_F(DataReductionProxyConfigServiceClientTest, DevRolloutAndQuic) {
proxies_for_http[1])
<< i;
EXPECT_TRUE(configurator()->proxies_for_https().empty()) << i;
+
+ // Test that the trusted SPDY proxy is updated correctly after each config
+ // retrieval.
+ bool expect_proxy_as_trusted =
bengr 2016/01/26 19:39:55 expect_proxy_as_trusted -> expect_proxy_is_trusted
tbansal1 2016/01/27 00:13:33 Done.
+ tests[i].expected_primary_proxy_scheme ==
+ net::ProxyServer::SCHEME_HTTPS &&
+ tests[i].enable_trusted_spdy_proxy_field_trial;
+ EXPECT_EQ(expect_proxy_as_trusted,
+ config()->IsTrustedSpdyProxy(net::ProxyServer::FromURI(
+ tests[i].expected_primary_proxy,
+ tests[i].expected_primary_proxy_scheme)))
+ << i;
}
}

Powered by Google App Engine
This is Rietveld 408576698