OLD | NEW |
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_basic_state.h" | 5 #include "net/http/http_basic_state.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
9 #include "net/base/request_priority.h" | 9 #include "net/base/request_priority.h" |
10 #include "net/http/http_request_info.h" | 10 #include "net/http/http_request_info.h" |
| 11 #include "net/log/net_log_with_source.h" |
11 #include "net/socket/client_socket_handle.h" | 12 #include "net/socket/client_socket_handle.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 | 14 |
14 namespace net { | 15 namespace net { |
15 namespace { | 16 namespace { |
16 | 17 |
17 TEST(HttpBasicStateTest, ConstructsProperly) { | 18 TEST(HttpBasicStateTest, ConstructsProperly) { |
18 ClientSocketHandle* const handle = new ClientSocketHandle; | 19 ClientSocketHandle* const handle = new ClientSocketHandle; |
19 // Ownership of |handle| is passed to |state|. | 20 // Ownership of |handle| is passed to |state|. |
20 const HttpBasicState state(base::WrapUnique(handle), true /* using_proxy */, | 21 const HttpBasicState state(base::WrapUnique(handle), true /* using_proxy */, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 request_info.url = GURL("http://www.example.com/path?foo=bar#hoge"); | 81 request_info.url = GURL("http://www.example.com/path?foo=bar#hoge"); |
81 request_info.method = "PUT"; | 82 request_info.method = "PUT"; |
82 state.Initialize(&request_info, LOW, NetLogWithSource(), | 83 state.Initialize(&request_info, LOW, NetLogWithSource(), |
83 CompletionCallback()); | 84 CompletionCallback()); |
84 EXPECT_EQ("PUT http://www.example.com/path?foo=bar HTTP/1.1\r\n", | 85 EXPECT_EQ("PUT http://www.example.com/path?foo=bar HTTP/1.1\r\n", |
85 state.GenerateRequestLine()); | 86 state.GenerateRequestLine()); |
86 } | 87 } |
87 | 88 |
88 } // namespace | 89 } // namespace |
89 } // namespace net | 90 } // namespace net |
OLD | NEW |