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

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

Issue 1357953002: Replace the existing SpdyHeaderBlock typedef with a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add NET_EXPORT to fix compile error on win_chromium_compile_dbg_ng. Created 5 years, 2 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_protocol.h ('k') | net/spdy/spdy_session.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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698