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

Unified Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 8156001: net: rework the NPN patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 2 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: net/spdy/spdy_network_transaction_unittest.cc
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 4a9e111080c35374e97ba4425511f55f7bb00336..f57a4637a300eb1ed6ee5ce4388d9daf2784fff4 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_->mutable_alternate_protocols()->SetAlternateProtocolFor(
HostPortPair("www.google.com", 80), 443,
HttpAlternateProtocols::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(

Powered by Google App Engine
This is Rietveld 408576698