diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 18:56:34 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 18:56:34 +0000 |
commit | 5285d9763b1680e6344425ec29e3c92e8bfc9b3d (patch) | |
tree | fa0d67ea7578fb6c7ee34e644222b5d2cf768e55 /net/spdy/spdy_network_transaction_unittest.cc | |
parent | c6e6617d80159e7c1dbf00ebf44f82b52f89f4ff (diff) | |
download | chromium_src-5285d9763b1680e6344425ec29e3c92e8bfc9b3d.zip chromium_src-5285d9763b1680e6344425ec29e3c92e8bfc9b3d.tar.gz chromium_src-5285d9763b1680e6344425ec29e3c92e8bfc9b3d.tar.bz2 |
net: rework the NPN patch.
This change moves the protocol selection logic out of NSS and into Chromium
code. This allows some things to be a little cleaner (no more wire-encoded NPN
strings) and also allows for some tricks that we have been considering for
SPDY+WebSockets.
As a consequence of this change, next protocols are now a
std::vector<std::string> rather than an encoded char*
BUG=none
TEST=SPDY still works with Google sites.
Review URL: http://codereview.chromium.org/8156001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_network_transaction_unittest.cc')
-rw-r--r-- | net/spdy/spdy_network_transaction_unittest.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index b7ee325..e51c4a5 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc @@ -24,10 +24,6 @@ namespace net { -// This is the expected list of advertised protocols from the browser's NPN -// list. -static const char kExpectedNPNString[] = "\x08http/1.1\x06spdy/2"; - enum SpdyNetworkTransactionTestTypes { SPDYNPN, SPDYNOSSL, @@ -122,13 +118,18 @@ class SpdyNetworkTransactionTest HttpStreamFactory::set_use_alternate_protocols(false); HttpStreamFactory::set_force_spdy_over_ssl(false); HttpStreamFactory::set_force_spdy_always(false); + + std::vector<std::string> next_protos; + next_protos.push_back("http/1.1"); + next_protos.push_back("spdy/2"); + switch (test_type_) { case SPDYNPN: session_->http_server_properties()->SetAlternateProtocol( HostPortPair("www.google.com", 80), 443, NPN_SPDY_2); HttpStreamFactory::set_use_alternate_protocols(true); - HttpStreamFactory::set_next_protos(kExpectedNPNString); + HttpStreamFactory::set_next_protos(next_protos); break; case SPDYNOSSL: HttpStreamFactory::set_force_spdy_over_ssl(false); @@ -852,8 +853,8 @@ TEST_P(SpdyNetworkTransactionTest, TwoGetsLateBindingFromPreconnect) { helper.session()->ssl_config_service()->GetSSLConfig(&preconnect_ssl_config); HttpStreamFactory* http_stream_factory = helper.session()->http_stream_factory(); - if (http_stream_factory->next_protos()) { - preconnect_ssl_config.next_protos = *http_stream_factory->next_protos(); + if (http_stream_factory->has_next_protos()) { + preconnect_ssl_config.next_protos = http_stream_factory->next_protos(); } http_stream_factory->PreconnectStreams( |