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> |
(...skipping 22 matching lines...) Expand all Loading... |
33 using HeaderKeyValuePair = std::pair<std::string, std::string>; | 33 using HeaderKeyValuePair = std::pair<std::string, std::string>; |
34 | 34 |
35 WebSocketStreamCreateTestBase(); | 35 WebSocketStreamCreateTestBase(); |
36 virtual ~WebSocketStreamCreateTestBase(); | 36 virtual ~WebSocketStreamCreateTestBase(); |
37 | 37 |
38 // A wrapper for CreateAndConnectStreamForTesting that knows about our default | 38 // A wrapper for CreateAndConnectStreamForTesting that knows about our default |
39 // parameters. | 39 // parameters. |
40 void CreateAndConnectStream(const std::string& socket_url, | 40 void CreateAndConnectStream(const std::string& socket_url, |
41 const std::vector<std::string>& sub_protocols, | 41 const std::vector<std::string>& sub_protocols, |
42 const url::Origin& origin, | 42 const url::Origin& origin, |
| 43 const std::string& additional_headers, |
43 std::unique_ptr<base::Timer> timer); | 44 std::unique_ptr<base::Timer> timer); |
44 | 45 |
45 static std::vector<HeaderKeyValuePair> RequestHeadersToVector( | 46 static std::vector<HeaderKeyValuePair> RequestHeadersToVector( |
46 const HttpRequestHeaders& headers); | 47 const HttpRequestHeaders& headers); |
47 static std::vector<HeaderKeyValuePair> ResponseHeadersToVector( | 48 static std::vector<HeaderKeyValuePair> ResponseHeadersToVector( |
48 const HttpResponseHeaders& headers); | 49 const HttpResponseHeaders& headers); |
49 | 50 |
50 const std::string& failure_message() const { return failure_message_; } | 51 const std::string& failure_message() const { return failure_message_; } |
51 bool has_failed() const { return has_failed_; } | 52 bool has_failed() const { return has_failed_; } |
52 | 53 |
(...skipping 26 matching lines...) Expand all Loading... |
79 base::RunLoop connect_run_loop_; | 80 base::RunLoop connect_run_loop_; |
80 | 81 |
81 private: | 82 private: |
82 class TestConnectDelegate; | 83 class TestConnectDelegate; |
83 DISALLOW_COPY_AND_ASSIGN(WebSocketStreamCreateTestBase); | 84 DISALLOW_COPY_AND_ASSIGN(WebSocketStreamCreateTestBase); |
84 }; | 85 }; |
85 | 86 |
86 } // namespace net | 87 } // namespace net |
87 | 88 |
88 #endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_CREATE_TEST_BASE_H_ | 89 #endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_CREATE_TEST_BASE_H_ |
OLD | NEW |