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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 &detail_->write, | 130 &detail_->write, |
131 1)); | 131 1)); |
132 socket_data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); | 132 socket_data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); |
133 socket_data->SetStop(sequence); | 133 socket_data->SetStop(sequence); |
134 AddRawExpectations(socket_data.Pass()); | 134 AddRawExpectations(socket_data.Pass()); |
135 } | 135 } |
136 | 136 |
137 void WebSocketDeterministicMockClientSocketFactoryMaker::AddRawExpectations( | 137 void WebSocketDeterministicMockClientSocketFactoryMaker::AddRawExpectations( |
138 scoped_ptr<DeterministicSocketData> socket_data) { | 138 scoped_ptr<DeterministicSocketData> socket_data) { |
139 detail_->factory.AddSocketDataProvider(socket_data.get()); | 139 detail_->factory.AddSocketDataProvider(socket_data.get()); |
140 detail_->socket_data_vector.push_back(socket_data.release()); | 140 detail_->socket_data_vector.push_back(socket_data.Pass()); |
141 } | 141 } |
142 | 142 |
143 void | 143 void |
144 WebSocketDeterministicMockClientSocketFactoryMaker::AddSSLSocketDataProvider( | 144 WebSocketDeterministicMockClientSocketFactoryMaker::AddSSLSocketDataProvider( |
145 scoped_ptr<SSLSocketDataProvider> ssl_socket_data) { | 145 scoped_ptr<SSLSocketDataProvider> ssl_socket_data) { |
146 detail_->factory.AddSSLSocketDataProvider(ssl_socket_data.get()); | 146 detail_->factory.AddSSLSocketDataProvider(ssl_socket_data.get()); |
147 detail_->ssl_socket_data_vector.push_back(ssl_socket_data.release()); | 147 detail_->ssl_socket_data_vector.push_back(ssl_socket_data.Pass()); |
148 } | 148 } |
149 | 149 |
150 WebSocketTestURLRequestContextHost::WebSocketTestURLRequestContextHost() | 150 WebSocketTestURLRequestContextHost::WebSocketTestURLRequestContextHost() |
151 : url_request_context_(true), url_request_context_initialized_(false) { | 151 : url_request_context_(true), url_request_context_initialized_(false) { |
152 url_request_context_.set_client_socket_factory(maker_.factory()); | 152 url_request_context_.set_client_socket_factory(maker_.factory()); |
153 } | 153 } |
154 | 154 |
155 WebSocketTestURLRequestContextHost::~WebSocketTestURLRequestContextHost() {} | 155 WebSocketTestURLRequestContextHost::~WebSocketTestURLRequestContextHost() {} |
156 | 156 |
157 void WebSocketTestURLRequestContextHost::AddRawExpectations( | 157 void WebSocketTestURLRequestContextHost::AddRawExpectations( |
(...skipping 18 matching lines...) Expand all Loading... |
176 if (!url_request_context_initialized_) { | 176 if (!url_request_context_initialized_) { |
177 url_request_context_.Init(); | 177 url_request_context_.Init(); |
178 // A Network Delegate is required to make the URLRequest::Delegate work. | 178 // A Network Delegate is required to make the URLRequest::Delegate work. |
179 url_request_context_.set_network_delegate(&network_delegate_); | 179 url_request_context_.set_network_delegate(&network_delegate_); |
180 url_request_context_initialized_ = true; | 180 url_request_context_initialized_ = true; |
181 } | 181 } |
182 return &url_request_context_; | 182 return &url_request_context_; |
183 } | 183 } |
184 | 184 |
185 } // namespace net | 185 } // namespace net |
OLD | NEW |