| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 5230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5241 request1.method = "GET"; | 5241 request1.method = "GET"; |
| 5242 request1.url = GURL("http://www.example.org/"); | 5242 request1.url = GURL("http://www.example.org/"); |
| 5243 request1.load_flags = 0; | 5243 request1.load_flags = 0; |
| 5244 | 5244 |
| 5245 HttpRequestInfo request2; | 5245 HttpRequestInfo request2; |
| 5246 request2.method = "GET"; | 5246 request2.method = "GET"; |
| 5247 request2.url = GURL("http://mail.example.org/"); | 5247 request2.url = GURL("http://mail.example.org/"); |
| 5248 request2.load_flags = 0; | 5248 request2.load_flags = 0; |
| 5249 | 5249 |
| 5250 // http://www.example.org/ | 5250 // http://www.example.org/ |
| 5251 std::unique_ptr<SpdyHeaderBlock> headers( | 5251 SpdyHeaderBlock headers( |
| 5252 spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/")); | 5252 spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/")); |
| 5253 std::unique_ptr<SpdySerializedFrame> get1( | 5253 std::unique_ptr<SpdySerializedFrame> get1( |
| 5254 spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, true)); | 5254 spdy_util_.ConstructSpdySyn(1, std::move(headers), LOWEST, true)); |
| 5255 std::unique_ptr<SpdySerializedFrame> get_resp1( | 5255 std::unique_ptr<SpdySerializedFrame> get_resp1( |
| 5256 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); | 5256 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 5257 std::unique_ptr<SpdySerializedFrame> body1( | 5257 std::unique_ptr<SpdySerializedFrame> body1( |
| 5258 spdy_util_.ConstructSpdyBodyFrame(1, "1", 1, true)); | 5258 spdy_util_.ConstructSpdyBodyFrame(1, "1", 1, true)); |
| 5259 spdy_util_.UpdateWithStreamDestruction(1); | 5259 spdy_util_.UpdateWithStreamDestruction(1); |
| 5260 | 5260 |
| 5261 // http://mail.example.org/ | 5261 // http://mail.example.org/ |
| 5262 std::unique_ptr<SpdyHeaderBlock> headers2( | 5262 SpdyHeaderBlock headers2( |
| 5263 spdy_util_.ConstructGetHeaderBlockForProxy("http://mail.example.org/")); | 5263 spdy_util_.ConstructGetHeaderBlockForProxy("http://mail.example.org/")); |
| 5264 std::unique_ptr<SpdySerializedFrame> get2( | 5264 std::unique_ptr<SpdySerializedFrame> get2( |
| 5265 spdy_util_.ConstructSpdySyn(3, *headers2, LOWEST, true)); | 5265 spdy_util_.ConstructSpdySyn(3, std::move(headers2), LOWEST, true)); |
| 5266 std::unique_ptr<SpdySerializedFrame> get_resp2( | 5266 std::unique_ptr<SpdySerializedFrame> get_resp2( |
| 5267 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3)); | 5267 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3)); |
| 5268 std::unique_ptr<SpdySerializedFrame> body2( | 5268 std::unique_ptr<SpdySerializedFrame> body2( |
| 5269 spdy_util_.ConstructSpdyBodyFrame(3, "22", 2, true)); | 5269 spdy_util_.ConstructSpdyBodyFrame(3, "22", 2, true)); |
| 5270 | 5270 |
| 5271 MockWrite spdy_writes[] = { | 5271 MockWrite spdy_writes[] = { |
| 5272 CreateMockWrite(*get1, 0), | 5272 CreateMockWrite(*get1, 0), |
| 5273 CreateMockWrite(*get2, 3), | 5273 CreateMockWrite(*get2, 3), |
| 5274 }; | 5274 }; |
| 5275 | 5275 |
| (...skipping 8746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14022 // http://crbug.com/134690 | 14022 // http://crbug.com/134690 |
| 14023 TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) { | 14023 TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) { |
| 14024 const std::string url1 = "http://www.example.org/"; | 14024 const std::string url1 = "http://www.example.org/"; |
| 14025 const std::string url2 = "https://news.example.org/"; | 14025 const std::string url2 = "https://news.example.org/"; |
| 14026 const std::string ip_addr = "1.2.3.4"; | 14026 const std::string ip_addr = "1.2.3.4"; |
| 14027 | 14027 |
| 14028 // Second SpdyTestUtil instance for the second socket. | 14028 // Second SpdyTestUtil instance for the second socket. |
| 14029 SpdyTestUtil spdy_util_secure(GetProtocol(), GetDependenciesFromPriority()); | 14029 SpdyTestUtil spdy_util_secure(GetProtocol(), GetDependenciesFromPriority()); |
| 14030 | 14030 |
| 14031 // SPDY GET for HTTP URL (through SPDY proxy) | 14031 // SPDY GET for HTTP URL (through SPDY proxy) |
| 14032 std::unique_ptr<SpdyHeaderBlock> headers( | 14032 SpdyHeaderBlock headers( |
| 14033 spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/")); | 14033 spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/")); |
| 14034 std::unique_ptr<SpdySerializedFrame> req1( | 14034 std::unique_ptr<SpdySerializedFrame> req1( |
| 14035 spdy_util_.ConstructSpdySyn(1, *headers, LOWEST, true)); | 14035 spdy_util_.ConstructSpdySyn(1, std::move(headers), LOWEST, true)); |
| 14036 | 14036 |
| 14037 MockWrite writes1[] = { | 14037 MockWrite writes1[] = { |
| 14038 CreateMockWrite(*req1, 0), | 14038 CreateMockWrite(*req1, 0), |
| 14039 }; | 14039 }; |
| 14040 | 14040 |
| 14041 std::unique_ptr<SpdySerializedFrame> resp1( | 14041 std::unique_ptr<SpdySerializedFrame> resp1( |
| 14042 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); | 14042 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 1)); |
| 14043 std::unique_ptr<SpdySerializedFrame> body1( | 14043 std::unique_ptr<SpdySerializedFrame> body1( |
| 14044 spdy_util_.ConstructSpdyBodyFrame(1, true)); | 14044 spdy_util_.ConstructSpdyBodyFrame(1, true)); |
| 14045 MockRead reads1[] = { | 14045 MockRead reads1[] = { |
| (...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16144 base::RunLoop().RunUntilIdle(); | 16144 base::RunLoop().RunUntilIdle(); |
| 16145 | 16145 |
| 16146 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); | 16146 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); |
| 16147 HttpRequestHeaders headers; | 16147 HttpRequestHeaders headers; |
| 16148 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); | 16148 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); |
| 16149 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); | 16149 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); |
| 16150 } | 16150 } |
| 16151 #endif // !defined(OS_IOS) | 16151 #endif // !defined(OS_IOS) |
| 16152 | 16152 |
| 16153 } // namespace net | 16153 } // namespace net |
| OLD | NEW |