OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef NET_WEBSOCKETS_WEBSOCKET_STREAM_CREATE_TEST_BASE_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_STREAM_CREATE_TEST_BASE_H_ |
6 #define NET_WEBSOCKETS_WEBSOCKET_STREAM_CREATE_TEST_BASE_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_STREAM_CREATE_TEST_BASE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "net/socket/socket_test_util.h" | 16 #include "net/socket/socket_test_util.h" |
17 #include "net/ssl/ssl_info.h" | 17 #include "net/ssl/ssl_info.h" |
18 #include "net/websockets/websocket_event_interface.h" | 18 #include "net/websockets/websocket_event_interface.h" |
19 #include "net/websockets/websocket_test_util.h" | 19 #include "net/websockets/websocket_test_util.h" |
20 | 20 |
21 class GURL; | 21 class GURL; |
22 | 22 |
23 namespace net { | 23 namespace net { |
24 | 24 |
25 class HttpRequestHeaders; | 25 class HttpRequestHeaders; |
26 class HttpResponseHeaders; | 26 class HttpResponseHeaders; |
| 27 class URLRequest; |
27 class WebSocketStream; | 28 class WebSocketStream; |
28 class WebSocketStreamRequest; | 29 class WebSocketStreamRequest; |
29 struct WebSocketHandshakeRequestInfo; | 30 struct WebSocketHandshakeRequestInfo; |
30 struct WebSocketHandshakeResponseInfo; | 31 struct WebSocketHandshakeResponseInfo; |
31 | 32 |
32 class WebSocketStreamCreateTestBase { | 33 class WebSocketStreamCreateTestBase { |
33 public: | 34 public: |
34 using HeaderKeyValuePair = std::pair<std::string, std::string>; | 35 using HeaderKeyValuePair = std::pair<std::string, std::string>; |
35 | 36 |
36 WebSocketStreamCreateTestBase(); | 37 WebSocketStreamCreateTestBase(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Only set if the connection failed. | 69 // Only set if the connection failed. |
69 std::string failure_message_; | 70 std::string failure_message_; |
70 bool has_failed_; | 71 bool has_failed_; |
71 std::unique_ptr<WebSocketHandshakeRequestInfo> request_info_; | 72 std::unique_ptr<WebSocketHandshakeRequestInfo> request_info_; |
72 std::unique_ptr<WebSocketHandshakeResponseInfo> response_info_; | 73 std::unique_ptr<WebSocketHandshakeResponseInfo> response_info_; |
73 std::unique_ptr<WebSocketEventInterface::SSLErrorCallbacks> | 74 std::unique_ptr<WebSocketEventInterface::SSLErrorCallbacks> |
74 ssl_error_callbacks_; | 75 ssl_error_callbacks_; |
75 SSLInfo ssl_info_; | 76 SSLInfo ssl_info_; |
76 bool ssl_fatal_; | 77 bool ssl_fatal_; |
77 std::vector<std::unique_ptr<SSLSocketDataProvider>> ssl_data_; | 78 std::vector<std::unique_ptr<SSLSocketDataProvider>> ssl_data_; |
| 79 URLRequest* url_request_; |
78 | 80 |
79 // This temporarily sets WebSocketEndpointLockManager unlock delay to zero | 81 // This temporarily sets WebSocketEndpointLockManager unlock delay to zero |
80 // during tests. | 82 // during tests. |
81 ScopedWebSocketEndpointZeroUnlockDelay zero_unlock_delay_; | 83 ScopedWebSocketEndpointZeroUnlockDelay zero_unlock_delay_; |
82 base::RunLoop connect_run_loop_; | 84 base::RunLoop connect_run_loop_; |
83 | 85 |
84 private: | 86 private: |
85 class TestConnectDelegate; | 87 class TestConnectDelegate; |
86 DISALLOW_COPY_AND_ASSIGN(WebSocketStreamCreateTestBase); | 88 DISALLOW_COPY_AND_ASSIGN(WebSocketStreamCreateTestBase); |
87 }; | 89 }; |
88 | 90 |
89 } // namespace net | 91 } // namespace net |
90 | 92 |
91 #endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_CREATE_TEST_BASE_H_ | 93 #endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_CREATE_TEST_BASE_H_ |
OLD | NEW |