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_test_util.h" | 5 #include "net/websockets/websocket_test_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 void WebSocketTestURLRequestContextHost::AddRawExpectations( | 144 void WebSocketTestURLRequestContextHost::AddRawExpectations( |
145 scoped_ptr<DeterministicSocketData> socket_data) { | 145 scoped_ptr<DeterministicSocketData> socket_data) { |
146 maker_.AddRawExpectations(socket_data.Pass()); | 146 maker_.AddRawExpectations(socket_data.Pass()); |
147 } | 147 } |
148 | 148 |
149 void WebSocketTestURLRequestContextHost::AddSSLSocketDataProvider( | 149 void WebSocketTestURLRequestContextHost::AddSSLSocketDataProvider( |
150 scoped_ptr<SSLSocketDataProvider> ssl_socket_data) { | 150 scoped_ptr<SSLSocketDataProvider> ssl_socket_data) { |
151 maker_.AddSSLSocketDataProvider(ssl_socket_data.Pass()); | 151 maker_.AddSSLSocketDataProvider(ssl_socket_data.Pass()); |
152 } | 152 } |
153 | 153 |
| 154 void WebSocketTestURLRequestContextHost::SetProxyService( |
| 155 scoped_ptr<ProxyService> proxy_service) { |
| 156 url_request_context_.set_proxy_service(proxy_service.release()); |
| 157 } |
| 158 |
154 TestURLRequestContext* | 159 TestURLRequestContext* |
155 WebSocketTestURLRequestContextHost::GetURLRequestContext() { | 160 WebSocketTestURLRequestContextHost::GetURLRequestContext() { |
156 if (!url_request_context_initialized_) { | 161 if (!url_request_context_initialized_) { |
157 url_request_context_.Init(); | 162 url_request_context_.Init(); |
158 // A Network Delegate is required to make the URLRequest::Delegate work. | 163 // A Network Delegate is required to make the URLRequest::Delegate work. |
159 url_request_context_.set_network_delegate(&network_delegate_); | 164 url_request_context_.set_network_delegate(&network_delegate_); |
160 url_request_context_initialized_ = true; | 165 url_request_context_initialized_ = true; |
161 } | 166 } |
162 return &url_request_context_; | 167 return &url_request_context_; |
163 } | 168 } |
164 | 169 |
165 } // namespace net | 170 } // namespace net |
OLD | NEW |