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

Unified Diff: chrome/browser/io_thread_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: 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: chrome/browser/io_thread_unittest.cc
diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc
index f3321ee333ee20d0974201282fab9850204c03a9..0952ceda0b68d851de8a976ceadb02881cb44a77 100644
--- a/chrome/browser/io_thread_unittest.cc
+++ b/chrome/browser/io_thread_unittest.cc
@@ -23,10 +23,13 @@
#include "components/proxy_config/proxy_config_pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
+#include "net/base/host_port_pair.h"
+#include "net/base/trusted_spdy_proxy_provider.h"
#include "net/http/http_auth_preferences.h"
#include "net/http/http_auth_scheme.h"
#include "net/http/http_network_session.h"
#include "net/http/http_server_properties_impl.h"
+#include "net/proxy/proxy_server.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_stream_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -183,6 +186,25 @@ TEST_F(IOThreadTest, SpdyCommandLineUseSpdyOff) {
EXPECT_EQ(0u, globals_.next_protos.size());
}
+// Tests that the trusted SPDY proxy is set correctly from the command line
+// switch.
+TEST_F(IOThreadTest, TrustedSpdyProxy) {
+ // When command line flag is unspecified, the proxy provider is unavailable.
+ ConfigureSpdyGlobals();
+ EXPECT_FALSE(globals_.trusted_spdy_proxy_provider);
+
+ const net::ProxyServer proxy = net::ProxyServer::FromURI(
+ "example.com:443", net::ProxyServer::SCHEME_HTTP);
bengr 2016/01/11 22:29:35 Once you fix things up so that everything uses Pro
tbansal1 2016/01/12 20:50:51 Done.
+ command_line_.AppendSwitchASCII(switches::kTrustedSpdyProxy,
+ proxy.host_port_pair().ToString());
+
+ ConfigureSpdyGlobals();
+ net::ProxyServer got_trusted_spdy_proxy;
bengr 2016/01/11 22:29:35 Call this trusted_spdy_proxy.
tbansal1 2016/01/12 20:50:51 obsolete.
+ globals_.trusted_spdy_proxy_provider->GetTrustedSpdyProxy(
+ &got_trusted_spdy_proxy);
+ EXPECT_EQ(proxy, got_trusted_spdy_proxy);
+}
+
TEST_F(IOThreadTest, NPNFieldTrialEnabled) {
field_trial_group_ = "Enable-experiment";
ConfigureNPNGlobals();

Powered by Google App Engine
This is Rietveld 408576698