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

Side by Side Diff: net/spdy/spdy_http_utils_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.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.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_http_utils.h" 5 #include "net/spdy/spdy_http_utils.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "net/http/http_request_info.h" 8 #include "net/http/http_request_info.h"
9 #include "net/spdy/spdy_framer.h" 9 #include "net/spdy/spdy_framer.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 GURL url("https://www.google.com/index.html"); 178 GURL url("https://www.google.com/index.html");
179 HttpRequestInfo request; 179 HttpRequestInfo request;
180 request.method = "CONNECT"; 180 request.method = "CONNECT";
181 request.url = url; 181 request.url = url;
182 request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, "Chrome/1.1"); 182 request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, "Chrome/1.1");
183 SpdyHeaderBlock headers; 183 SpdyHeaderBlock headers;
184 CreateSpdyHeadersFromHttpRequest(request, request.extra_headers, HTTP2, 184 CreateSpdyHeadersFromHttpRequest(request, request.extra_headers, HTTP2,
185 kDirect, &headers); 185 kDirect, &headers);
186 EXPECT_EQ("CONNECT", headers[":method"]); 186 EXPECT_EQ("CONNECT", headers[":method"]);
187 EXPECT_TRUE(headers.end() == headers.find(":scheme")); 187 EXPECT_TRUE(headers.end() == headers.find(":scheme"));
188 EXPECT_EQ("www.google.com", headers[":authority"]); 188 EXPECT_EQ("www.google.com:443", headers[":authority"]);
189 EXPECT_EQ("www.google.com:443", headers[":path"]); 189 EXPECT_EQ(0u, headers.count(":path"));
190 EXPECT_EQ(0u, headers.count(":scheme"));
190 EXPECT_TRUE(headers.end() == headers.find(":version")); 191 EXPECT_TRUE(headers.end() == headers.find(":version"));
191 EXPECT_EQ("Chrome/1.1", headers["user-agent"]); 192 EXPECT_EQ("Chrome/1.1", headers["user-agent"]);
192 } 193 }
193 194
194 } // namespace net 195 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_utils.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698