| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "net/base/mock_cert_verifier.h" | 8 #include "net/base/mock_cert_verifier.h" |
| 9 #include "net/base/mock_host_resolver.h" | 9 #include "net/base/mock_host_resolver.h" |
| 10 #include "net/base/ssl_config_service_defaults.h" | 10 #include "net/base/ssl_config_service_defaults.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 MockRandom random_generator_; | 237 MockRandom random_generator_; |
| 238 HttpServerPropertiesImpl http_server_properties; | 238 HttpServerPropertiesImpl http_server_properties; |
| 239 HttpNetworkSession::Params params_; | 239 HttpNetworkSession::Params params_; |
| 240 }; | 240 }; |
| 241 | 241 |
| 242 TEST_F(QuicNetworkTransactionTest, UseAlternateProtocolForQuic) { | 242 TEST_F(QuicNetworkTransactionTest, UseAlternateProtocolForQuic) { |
| 243 HttpStreamFactory::set_use_alternate_protocols(true); | 243 HttpStreamFactory::set_use_alternate_protocols(true); |
| 244 HttpStreamFactory::SetNextProtos(QuicNextProtos()); | 244 HttpStreamFactory::SetNextProtos(QuicNextProtos()); |
| 245 params_.enable_quic = true; | 245 params_.enable_quic = true; |
| 246 params_.quic_clock = clock_; | 246 params_.quic_clock = clock_; |
| 247 params_.use_spdy_over_quic = true; | |
| 248 params_.quic_random = &random_generator_; | 247 params_.quic_random = &random_generator_; |
| 249 | 248 |
| 250 HttpRequestInfo request; | 249 HttpRequestInfo request; |
| 251 request.method = "GET"; | 250 request.method = "GET"; |
| 252 request.url = GURL("http://www.google.com/"); | 251 request.url = GURL("http://www.google.com/"); |
| 253 request.load_flags = 0; | 252 request.load_flags = 0; |
| 254 | 253 |
| 255 MockRead data_reads[] = { | 254 MockRead data_reads[] = { |
| 256 MockRead("HTTP/1.1 200 OK\r\n"), | 255 MockRead("HTTP/1.1 200 OK\r\n"), |
| 257 MockRead(kQuicAlternateProtocolHttpHeader), | 256 MockRead(kQuicAlternateProtocolHttpHeader), |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 ASSERT_TRUE(response->headers != NULL); | 331 ASSERT_TRUE(response->headers != NULL); |
| 333 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 332 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
| 334 EXPECT_TRUE(response->was_fetched_via_spdy); | 333 EXPECT_TRUE(response->was_fetched_via_spdy); |
| 335 | 334 |
| 336 ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); | 335 ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); |
| 337 EXPECT_EQ("hello!", response_data); | 336 EXPECT_EQ("hello!", response_data); |
| 338 } | 337 } |
| 339 | 338 |
| 340 } // namespace test | 339 } // namespace test |
| 341 } // namespace net | 340 } // namespace net |
| OLD | NEW |