| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Allow a proxy to be set. Usage: | 119 // Allow a proxy to be set. Usage: |
| 120 // SetProxyConfig("proxy1:8000"); | 120 // SetProxyConfig("proxy1:8000"); |
| 121 // Any syntax accepted by net::ProxyConfig::ParseFromString() will work. | 121 // Any syntax accepted by net::ProxyConfig::ParseFromString() will work. |
| 122 // Do not call after GetURLRequestContext() has been called. | 122 // Do not call after GetURLRequestContext() has been called. |
| 123 void SetProxyConfig(const std::string& proxy_rules); | 123 void SetProxyConfig(const std::string& proxy_rules); |
| 124 | 124 |
| 125 // Call after calling one of SetExpections() or AddRawExpectations(). The | 125 // Call after calling one of SetExpections() or AddRawExpectations(). The |
| 126 // returned pointer remains owned by this object. | 126 // returned pointer remains owned by this object. |
| 127 TestURLRequestContext* GetURLRequestContext(); | 127 TestURLRequestContext* GetURLRequestContext(); |
| 128 | 128 |
| 129 const TestNetworkDelegate& network_delegate() const { |
| 130 return network_delegate_; |
| 131 } |
| 132 |
| 129 private: | 133 private: |
| 130 WebSocketMockClientSocketFactoryMaker maker_; | 134 WebSocketMockClientSocketFactoryMaker maker_; |
| 131 TestURLRequestContext url_request_context_; | 135 TestURLRequestContext url_request_context_; |
| 132 TestNetworkDelegate network_delegate_; | 136 TestNetworkDelegate network_delegate_; |
| 133 std::unique_ptr<ProxyService> proxy_service_; | 137 std::unique_ptr<ProxyService> proxy_service_; |
| 134 bool url_request_context_initialized_; | 138 bool url_request_context_initialized_; |
| 135 | 139 |
| 136 DISALLOW_COPY_AND_ASSIGN(WebSocketTestURLRequestContextHost); | 140 DISALLOW_COPY_AND_ASSIGN(WebSocketTestURLRequestContextHost); |
| 137 }; | 141 }; |
| 138 | 142 |
| 139 } // namespace net | 143 } // namespace net |
| 140 | 144 |
| 141 #endif // NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ | 145 #endif // NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_ |
| OLD | NEW |