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/websockets/websocket_handshake_stream_create_helper.h" | 5 #include "net/websockets/websocket_handshake_stream_create_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 : pool_(1, 1, socket_factory_maker_.factory()) {} | 34 : pool_(1, 1, socket_factory_maker_.factory()) {} |
35 | 35 |
36 // The created socket expects |expect_written| to be written to the socket, | 36 // The created socket expects |expect_written| to be written to the socket, |
37 // and will respond with |return_to_read|. The test will fail if the expected | 37 // and will respond with |return_to_read|. The test will fail if the expected |
38 // text is not written, or if all the bytes are not read. | 38 // text is not written, or if all the bytes are not read. |
39 scoped_ptr<ClientSocketHandle> CreateClientSocketHandle( | 39 scoped_ptr<ClientSocketHandle> CreateClientSocketHandle( |
40 const std::string& expect_written, | 40 const std::string& expect_written, |
41 const std::string& return_to_read) { | 41 const std::string& return_to_read) { |
42 socket_factory_maker_.SetExpectations(expect_written, return_to_read); | 42 socket_factory_maker_.SetExpectations(expect_written, return_to_read); |
43 scoped_ptr<ClientSocketHandle> socket_handle(new ClientSocketHandle); | 43 scoped_ptr<ClientSocketHandle> socket_handle(new ClientSocketHandle); |
44 socket_handle->Init( | 44 socket_handle->Init("a", scoped_refptr<MockTransportSocketParams>(), MEDIUM, |
45 "a", | 45 ClientSocketPool::RespectLimits::ENABLED, |
46 scoped_refptr<MockTransportSocketParams>(), | 46 CompletionCallback(), &pool_, BoundNetLog()); |
47 MEDIUM, | |
48 CompletionCallback(), | |
49 &pool_, | |
50 BoundNetLog()); | |
51 return socket_handle; | 47 return socket_handle; |
52 } | 48 } |
53 | 49 |
54 private: | 50 private: |
55 WebSocketMockClientSocketFactoryMaker socket_factory_maker_; | 51 WebSocketMockClientSocketFactoryMaker socket_factory_maker_; |
56 MockTransportClientSocketPool pool_; | 52 MockTransportClientSocketPool pool_; |
57 | 53 |
58 DISALLOW_COPY_AND_ASSIGN(MockClientSocketHandleFactory); | 54 DISALLOW_COPY_AND_ASSIGN(MockClientSocketHandleFactory); |
59 }; | 55 }; |
60 | 56 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 177 |
182 EXPECT_EQ( | 178 EXPECT_EQ( |
183 "permessage-deflate;" | 179 "permessage-deflate;" |
184 " client_max_window_bits=14; server_max_window_bits=14;" | 180 " client_max_window_bits=14; server_max_window_bits=14;" |
185 " server_no_context_takeover; client_no_context_takeover", | 181 " server_no_context_takeover; client_no_context_takeover", |
186 stream->GetExtensions()); | 182 stream->GetExtensions()); |
187 } | 183 } |
188 | 184 |
189 } // namespace | 185 } // namespace |
190 } // namespace net | 186 } // namespace net |
OLD | NEW |