| 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 "net/spdy/spdy_proxy_client_socket.h" | 5 #include "net/spdy/spdy_proxy_client_socket.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 for (int i = 0; i < num_reads; i++) { | 303 for (int i = 0; i < num_reads; i++) { |
| 304 Run(1); | 304 Run(1); |
| 305 AssertSyncReadEquals(kMsg2, kLen2); | 305 AssertSyncReadEquals(kMsg2, kLen2); |
| 306 } | 306 } |
| 307 | 307 |
| 308 write_callback_.WaitForResult(); | 308 write_callback_.WaitForResult(); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void SpdyProxyClientSocketTest::PopulateConnectRequestIR( | 311 void SpdyProxyClientSocketTest::PopulateConnectRequestIR( |
| 312 SpdyHeaderBlock* block) { | 312 SpdyHeaderBlock* block) { |
| 313 spdy_util_.MaybeAddVersionHeader(block); |
| 313 (*block)[spdy_util_.GetMethodKey()] = "CONNECT"; | 314 (*block)[spdy_util_.GetMethodKey()] = "CONNECT"; |
| 314 if (spdy_util_.spdy_version() == HTTP2) { | 315 if (spdy_util_.spdy_version() == HTTP2) { |
| 315 (*block)[spdy_util_.GetHostKey()] = kOriginHostPort; | 316 (*block)[spdy_util_.GetHostKey()] = kOriginHostPort; |
| 316 } else { | 317 } else { |
| 318 (*block)[spdy_util_.GetHostKey()] = kOriginHost; |
| 317 (*block)[spdy_util_.GetPathKey()] = kOriginHostPort; | 319 (*block)[spdy_util_.GetPathKey()] = kOriginHostPort; |
| 318 (*block)[spdy_util_.GetHostKey()] = kOriginHost; | |
| 319 } | 320 } |
| 320 (*block)["user-agent"] = kUserAgent; | 321 (*block)["user-agent"] = kUserAgent; |
| 321 spdy_util_.MaybeAddVersionHeader(block); | |
| 322 } | 322 } |
| 323 | 323 |
| 324 void SpdyProxyClientSocketTest::PopulateConnectReplyIR(SpdyHeaderBlock* block, | 324 void SpdyProxyClientSocketTest::PopulateConnectReplyIR(SpdyHeaderBlock* block, |
| 325 const char* status) { | 325 const char* status) { |
| 326 (*block)[spdy_util_.GetStatusKey()] = status; | 326 (*block)[spdy_util_.GetStatusKey()] = status; |
| 327 spdy_util_.MaybeAddVersionHeader(block); | 327 spdy_util_.MaybeAddVersionHeader(block); |
| 328 } | 328 } |
| 329 | 329 |
| 330 // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. | 330 // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. |
| 331 SpdyFrame* | 331 SpdyFrame* |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 | 1376 |
| 1377 EXPECT_FALSE(sock_.get()); | 1377 EXPECT_FALSE(sock_.get()); |
| 1378 EXPECT_TRUE(read_callback.have_result()); | 1378 EXPECT_TRUE(read_callback.have_result()); |
| 1379 EXPECT_FALSE(write_callback_.have_result()); | 1379 EXPECT_FALSE(write_callback_.have_result()); |
| 1380 | 1380 |
| 1381 // Let the RST_STREAM write while |rst| is in-scope. | 1381 // Let the RST_STREAM write while |rst| is in-scope. |
| 1382 base::MessageLoop::current()->RunUntilIdle(); | 1382 base::MessageLoop::current()->RunUntilIdle(); |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 } // namespace net | 1385 } // namespace net |
| OLD | NEW |