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

Unified Diff: net/quic/quic_network_transaction_unittest.cc

Issue 17410014: Actually enable Alternate-Protocol support for QUIC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reorder Created 7 years, 6 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
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_network_transaction_unittest.cc
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index d93032c155aa6d3356c365c6bb5f6e2aa206b974..0edf99bbbff8b1283efea4346fd4f676e984393f 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -46,15 +46,7 @@ namespace {
// This is the expected return from a current server advertising QUIC.
static const char kQuicAlternateProtocolHttpHeader[] =
- "Alternate-Protocol: 443:quic\r\n\r\n";
-
-// Returns a vector of NPN protocol strings for negotiating QUIC.
-std::vector<std::string> QuicNextProtos() {
- std::vector<std::string> protos;
- protos.push_back("http/1.1");
- protos.push_back("quic");
- return protos;
-}
+ "Alternate-Protocol: 80:quic\r\n\r\n";
} // namespace
@@ -447,8 +439,7 @@ TEST_F(QuicNetworkTransactionTest, DoNotForceQuicForHttps) {
}
TEST_F(QuicNetworkTransactionTest, UseAlternateProtocolForQuic) {
- HttpStreamFactory::set_use_alternate_protocols(true);
- HttpStreamFactory::SetNextProtos(QuicNextProtos());
+ HttpStreamFactory::EnableNpnSpdy(); // Enables QUIC too.
MockRead http_reads[] = {
MockRead("HTTP/1.1 200 OK\r\n"),
@@ -497,8 +488,7 @@ TEST_F(QuicNetworkTransactionTest, UseAlternateProtocolForQuic) {
}
TEST_F(QuicNetworkTransactionTest, DontUseAlternateProtocolForQuicHttps) {
- HttpStreamFactory::set_use_alternate_protocols(true);
- HttpStreamFactory::SetNextProtos(QuicNextProtos());
+ HttpStreamFactory::EnableNpnSpdy(); // Enables QUIC too.
MockRead http_reads[] = {
MockRead("HTTP/1.1 200 OK\r\n"),
@@ -526,8 +516,7 @@ TEST_F(QuicNetworkTransactionTest, DontUseAlternateProtocolForQuicHttps) {
}
TEST_F(QuicNetworkTransactionTest, ZeroRTT) {
- HttpStreamFactory::set_use_alternate_protocols(true);
- HttpStreamFactory::SetNextProtos(QuicNextProtos());
+ HttpStreamFactory::EnableNpnSpdy(); // Enables QUIC too.
scoped_ptr<QuicEncryptedPacket> req(
ConstructDataPacket(1, 3, true, true, 0, GetRequestString("GET", "/")));
@@ -559,8 +548,7 @@ TEST_F(QuicNetworkTransactionTest, ZeroRTT) {
}
TEST_F(QuicNetworkTransactionTest, BrokenAlternateProtocol) {
- HttpStreamFactory::set_use_alternate_protocols(true);
- HttpStreamFactory::SetNextProtos(QuicNextProtos());
+ HttpStreamFactory::EnableNpnSpdy(); // Enables QUIC too.
// Alternate-protocol job
scoped_ptr<QuicEncryptedPacket> close(ConstructConnectionClosePacket(1));
@@ -591,8 +579,7 @@ TEST_F(QuicNetworkTransactionTest, BrokenAlternateProtocol) {
}
TEST_F(QuicNetworkTransactionTest, BrokenAlternateProtocolReadError) {
- HttpStreamFactory::set_use_alternate_protocols(true);
- HttpStreamFactory::SetNextProtos(QuicNextProtos());
+ HttpStreamFactory::EnableNpnSpdy(); // Enables QUIC too.
// Alternate-protocol job
MockRead quic_reads[] = {
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698