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

Side by Side Diff: net/spdy/spdy_proxy_client_socket_unittest.cc

Issue 1257623004: Send appropriate pseudo-headers in HTTP/2 CONNECT request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_http_utils_unittest.cc ('k') | net/spdy/spdy_test_util_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 Run(1); 305 Run(1);
306 AssertSyncReadEquals(kMsg2, kLen2); 306 AssertSyncReadEquals(kMsg2, kLen2);
307 } 307 }
308 308
309 write_callback_.WaitForResult(); 309 write_callback_.WaitForResult();
310 } 310 }
311 311
312 void SpdyProxyClientSocketTest::PopulateConnectRequestIR( 312 void SpdyProxyClientSocketTest::PopulateConnectRequestIR(
313 SpdyHeaderBlock* block) { 313 SpdyHeaderBlock* block) {
314 (*block)[spdy_util_.GetMethodKey()] = "CONNECT"; 314 (*block)[spdy_util_.GetMethodKey()] = "CONNECT";
315 (*block)[spdy_util_.GetPathKey()] = kOriginHostPort; 315 if (spdy_util_.spdy_version() == HTTP2) {
316 (*block)[spdy_util_.GetHostKey()] = kOriginHost; 316 (*block)[spdy_util_.GetHostKey()] = kOriginHostPort;
317 } else {
318 (*block)[spdy_util_.GetPathKey()] = kOriginHostPort;
319 (*block)[spdy_util_.GetHostKey()] = kOriginHost;
320 }
317 (*block)["user-agent"] = kUserAgent; 321 (*block)["user-agent"] = kUserAgent;
318 spdy_util_.MaybeAddVersionHeader(block); 322 spdy_util_.MaybeAddVersionHeader(block);
319 } 323 }
320 324
321 void SpdyProxyClientSocketTest::PopulateConnectReplyIR(SpdyHeaderBlock* block, 325 void SpdyProxyClientSocketTest::PopulateConnectReplyIR(SpdyHeaderBlock* block,
322 const char* status) { 326 const char* status) {
323 (*block)[spdy_util_.GetStatusKey()] = status; 327 (*block)[spdy_util_.GetStatusKey()] = status;
324 spdy_util_.MaybeAddVersionHeader(block); 328 spdy_util_.MaybeAddVersionHeader(block);
325 } 329 }
326 330
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 1377
1374 EXPECT_FALSE(sock_.get()); 1378 EXPECT_FALSE(sock_.get());
1375 EXPECT_TRUE(read_callback.have_result()); 1379 EXPECT_TRUE(read_callback.have_result());
1376 EXPECT_FALSE(write_callback_.have_result()); 1380 EXPECT_FALSE(write_callback_.have_result());
1377 1381
1378 // Let the RST_STREAM write while |rst| is in-scope. 1382 // Let the RST_STREAM write while |rst| is in-scope.
1379 base::MessageLoop::current()->RunUntilIdle(); 1383 base::MessageLoop::current()->RunUntilIdle();
1380 } 1384 }
1381 1385
1382 } // namespace net 1386 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_utils_unittest.cc ('k') | net/spdy/spdy_test_util_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698