OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_job.h" | 5 #include "net/websockets/websocket_job.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 friend class base::RefCountedThreadSafe<MockURLRequestContext>; | 251 friend class base::RefCountedThreadSafe<MockURLRequestContext>; |
252 virtual ~MockURLRequestContext() {} | 252 virtual ~MockURLRequestContext() {} |
253 | 253 |
254 net::TransportSecurityState transport_security_state_; | 254 net::TransportSecurityState transport_security_state_; |
255 }; | 255 }; |
256 | 256 |
257 class MockHttpTransactionFactory : public net::HttpTransactionFactory { | 257 class MockHttpTransactionFactory : public net::HttpTransactionFactory { |
258 public: | 258 public: |
259 MockHttpTransactionFactory(net::OrderedSocketData* data) { | 259 MockHttpTransactionFactory(net::OrderedSocketData* data) { |
260 data_ = data; | 260 data_ = data; |
261 net::MockConnect connect_data(false, net::OK); | 261 net::MockConnect connect_data(net::SYNCHRONOUS, net::OK); |
262 data_->set_connect_data(connect_data); | 262 data_->set_connect_data(connect_data); |
263 session_deps_.reset(new net::SpdySessionDependencies); | 263 session_deps_.reset(new net::SpdySessionDependencies); |
264 session_deps_->socket_factory->AddSocketDataProvider(data_); | 264 session_deps_->socket_factory->AddSocketDataProvider(data_); |
265 http_session_ = | 265 http_session_ = |
266 net::SpdySessionDependencies::SpdyCreateSession(session_deps_.get()); | 266 net::SpdySessionDependencies::SpdyCreateSession(session_deps_.get()); |
267 host_port_pair_.set_host("example.com"); | 267 host_port_pair_.set_host("example.com"); |
268 host_port_pair_.set_port(80); | 268 host_port_pair_.set_port(80); |
269 host_port_proxy_pair_.first = host_port_pair_; | 269 host_port_proxy_pair_.first = host_port_pair_; |
270 host_port_proxy_pair_.second = net::ProxyServer::Direct(); | 270 host_port_proxy_pair_.second = net::ProxyServer::Direct(); |
271 net::SpdySessionPool* spdy_session_pool = | 271 net::SpdySessionPool* spdy_session_pool = |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 | 1085 |
1086 TEST_F(WebSocketJobTest, ThrottlingSpdySpdyEnabled) { | 1086 TEST_F(WebSocketJobTest, ThrottlingSpdySpdyEnabled) { |
1087 WebSocketJob::set_websocket_over_spdy_enabled(true); | 1087 WebSocketJob::set_websocket_over_spdy_enabled(true); |
1088 TestConnectBySpdy(SPDY_ON, THROTTLING_ON); | 1088 TestConnectBySpdy(SPDY_ON, THROTTLING_ON); |
1089 } | 1089 } |
1090 | 1090 |
1091 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. | 1091 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. |
1092 // TODO(toyoshim,yutak): Add tests to verify closing handshake. | 1092 // TODO(toyoshim,yutak): Add tests to verify closing handshake. |
1093 | 1093 |
1094 } // namespace net | 1094 } // namespace net |
OLD | NEW |