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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 params_.http_server_properties = http_server_properties_.GetWeakPtr(); | 245 params_.http_server_properties = http_server_properties_.GetWeakPtr(); |
246 params_.quic_supported_versions = SupportedVersions(GetParam()); | 246 params_.quic_supported_versions = SupportedVersions(GetParam()); |
247 | 247 |
248 if (use_next_protos) { | 248 if (use_next_protos) { |
249 params_.use_alternate_protocols = true; | 249 params_.use_alternate_protocols = true; |
250 params_.next_protos = NextProtosWithSpdyAndQuic(true, true); | 250 params_.next_protos = NextProtosWithSpdyAndQuic(true, true); |
251 } | 251 } |
252 | 252 |
253 session_ = new HttpNetworkSession(params_); | 253 session_ = new HttpNetworkSession(params_); |
254 session_->quic_stream_factory()->set_require_confirmation(false); | 254 session_->quic_stream_factory()->set_require_confirmation(false); |
| 255 ASSERT_EQ(params_.quic_socket_receive_buffer_size, |
| 256 session_->quic_stream_factory()->socket_receive_buffer_size()); |
255 } | 257 } |
256 | 258 |
257 void CheckWasQuicResponse(const scoped_ptr<HttpNetworkTransaction>& trans) { | 259 void CheckWasQuicResponse(const scoped_ptr<HttpNetworkTransaction>& trans) { |
258 const HttpResponseInfo* response = trans->GetResponseInfo(); | 260 const HttpResponseInfo* response = trans->GetResponseInfo(); |
259 ASSERT_TRUE(response != nullptr); | 261 ASSERT_TRUE(response != nullptr); |
260 ASSERT_TRUE(response->headers.get() != nullptr); | 262 ASSERT_TRUE(response->headers.get() != nullptr); |
261 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 263 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
262 EXPECT_TRUE(response->was_fetched_via_spdy); | 264 EXPECT_TRUE(response->was_fetched_via_spdy); |
263 EXPECT_TRUE(response->was_npn_negotiated); | 265 EXPECT_TRUE(response->was_npn_negotiated); |
264 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3, | 266 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3, |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 | 1385 |
1384 request_.url = GURL("https://www.example.org:443"); | 1386 request_.url = GURL("https://www.example.org:443"); |
1385 AddHangingNonAlternateProtocolSocketData(); | 1387 AddHangingNonAlternateProtocolSocketData(); |
1386 CreateSessionWithNextProtos(); | 1388 CreateSessionWithNextProtos(); |
1387 AddQuicAlternateProtocolMapping(MockCryptoClientStream::CONFIRM_HANDSHAKE); | 1389 AddQuicAlternateProtocolMapping(MockCryptoClientStream::CONFIRM_HANDSHAKE); |
1388 SendRequestAndExpectQuicResponse("hello!"); | 1390 SendRequestAndExpectQuicResponse("hello!"); |
1389 } | 1391 } |
1390 | 1392 |
1391 } // namespace test | 1393 } // namespace test |
1392 } // namespace net | 1394 } // namespace net |
OLD | NEW |