| 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 #ifndef NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ |
| 6 #define NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 ~WebSocketTestURLRequestContextHost(); | 94 ~WebSocketTestURLRequestContextHost(); |
| 95 | 95 |
| 96 void SetExpectations(const std::string& expect_written, | 96 void SetExpectations(const std::string& expect_written, |
| 97 const std::string& return_to_read) { | 97 const std::string& return_to_read) { |
| 98 maker_.SetExpectations(expect_written, return_to_read); | 98 maker_.SetExpectations(expect_written, return_to_read); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void SetRawExpectations(scoped_ptr<DeterministicSocketData> socket_data); | 101 void SetRawExpectations(scoped_ptr<DeterministicSocketData> socket_data); |
| 102 | 102 |
| 103 // Call after calling one of SetExpections() or SetRawExpectations(). The | 103 // Call after calling one of SetExpections() or SetRawExpectations(). The |
| 104 // returned pointer remains owned by this object. This should only be called | 104 // returned pointer remains owned by this object. |
| 105 // once. | |
| 106 TestURLRequestContext* GetURLRequestContext(); | 105 TestURLRequestContext* GetURLRequestContext(); |
| 107 | 106 |
| 108 private: | 107 private: |
| 109 WebSocketDeterministicMockClientSocketFactoryMaker maker_; | 108 WebSocketDeterministicMockClientSocketFactoryMaker maker_; |
| 110 TestURLRequestContext url_request_context_; | 109 TestURLRequestContext url_request_context_; |
| 111 TestNetworkDelegate network_delegate_; | 110 TestNetworkDelegate network_delegate_; |
| 111 bool url_request_context_initialized_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(WebSocketTestURLRequestContextHost); | 113 DISALLOW_COPY_AND_ASSIGN(WebSocketTestURLRequestContextHost); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace net | 116 } // namespace net |
| 117 | 117 |
| 118 #endif // NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ | 118 #endif // NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ |
| OLD | NEW |