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

Side by Side Diff: net/http/http_network_transaction_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 | « no previous file | net/spdy/spdy_http_utils.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 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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3822 matching lines...) Expand 10 before | Expand all | Expand 10 after
3833 scoped_ptr<SpdyFrame> wrapped_get_resp1( 3833 scoped_ptr<SpdyFrame> wrapped_get_resp1(
3834 spdy_util_.ConstructSpdyBodyFrame(1, resp1, strlen(resp1), false)); 3834 spdy_util_.ConstructSpdyBodyFrame(1, resp1, strlen(resp1), false));
3835 scoped_ptr<SpdyFrame> wrapped_body1( 3835 scoped_ptr<SpdyFrame> wrapped_body1(
3836 spdy_util_.ConstructSpdyBodyFrame(1, "1", 1, false)); 3836 spdy_util_.ConstructSpdyBodyFrame(1, "1", 1, false));
3837 scoped_ptr<SpdyFrame> window_update( 3837 scoped_ptr<SpdyFrame> window_update(
3838 spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size())); 3838 spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1->size()));
3839 3839
3840 // CONNECT to mail.example.org:443 via SPDY. 3840 // CONNECT to mail.example.org:443 via SPDY.
3841 SpdyHeaderBlock connect2_block; 3841 SpdyHeaderBlock connect2_block;
3842 connect2_block[spdy_util_.GetMethodKey()] = "CONNECT"; 3842 connect2_block[spdy_util_.GetMethodKey()] = "CONNECT";
3843 connect2_block[spdy_util_.GetPathKey()] = "mail.example.org:443"; 3843 if (GetParam() >= kProtoHTTP2MinimumVersion) {
3844 connect2_block[spdy_util_.GetHostKey()] = "mail.example.org"; 3844 connect2_block[spdy_util_.GetHostKey()] = "mail.example.org:443";
3845 } else {
3846 connect2_block[spdy_util_.GetPathKey()] = "mail.example.org:443";
3847 connect2_block[spdy_util_.GetHostKey()] = "mail.example.org";
3848 }
3845 spdy_util_.MaybeAddVersionHeader(&connect2_block); 3849 spdy_util_.MaybeAddVersionHeader(&connect2_block);
3846 scoped_ptr<SpdyFrame> connect2( 3850 scoped_ptr<SpdyFrame> connect2(
3847 spdy_util_.ConstructSpdySyn(3, connect2_block, LOWEST, false, false)); 3851 spdy_util_.ConstructSpdySyn(3, connect2_block, LOWEST, false, false));
3848 3852
3849 scoped_ptr<SpdyFrame> conn_resp2( 3853 scoped_ptr<SpdyFrame> conn_resp2(
3850 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3)); 3854 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
3851 3855
3852 // Fetch https://mail.example.org/ via HTTP. 3856 // Fetch https://mail.example.org/ via HTTP.
3853 const char get2[] = 3857 const char get2[] =
3854 "GET / HTTP/1.1\r\n" 3858 "GET / HTTP/1.1\r\n"
(...skipping 10320 matching lines...) Expand 10 before | Expand all | Expand 10 after
14175 ASSERT_TRUE(response); 14179 ASSERT_TRUE(response);
14176 ASSERT_TRUE(response->headers.get()); 14180 ASSERT_TRUE(response->headers.get());
14177 14181
14178 EXPECT_EQ(101, response->headers->response_code()); 14182 EXPECT_EQ(101, response->headers->response_code());
14179 14183
14180 trans.reset(); 14184 trans.reset();
14181 session->CloseAllConnections(); 14185 session->CloseAllConnections();
14182 } 14186 }
14183 14187
14184 } // namespace net 14188 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_http_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698