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_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 Loading... |
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 |
OLD | NEW |