OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/spdy/spdy_websocket_stream.h" | 5 #include "net/spdy/spdy_websocket_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 int InitSession(MockRead* reads, size_t reads_count, | 248 int InitSession(MockRead* reads, size_t reads_count, |
249 MockWrite* writes, size_t writes_count, | 249 MockWrite* writes, size_t writes_count, |
250 bool throttling) { | 250 bool throttling) { |
251 data_ = new OrderedSocketData(reads, reads_count, writes, writes_count); | 251 data_ = new OrderedSocketData(reads, reads_count, writes, writes_count); |
252 session_deps_.socket_factory->AddSocketDataProvider(data_.get()); | 252 session_deps_.socket_factory->AddSocketDataProvider(data_.get()); |
253 http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); | 253 http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); |
254 SpdySessionPool* spdy_session_pool(http_session_->spdy_session_pool()); | 254 SpdySessionPool* spdy_session_pool(http_session_->spdy_session_pool()); |
255 | 255 |
256 if (throttling) { | 256 if (throttling) { |
257 // Set max concurrent streams to 1. | 257 // Set max concurrent streams to 1. |
258 spdy_session_pool->mutable_spdy_settings()->Set( | 258 spdy_session_pool->http_server_properties()->SetSpdySettings( |
259 host_port_pair_, spdy_settings_to_set_); | 259 host_port_pair_, spdy_settings_to_set_); |
260 } | 260 } |
261 | 261 |
262 EXPECT_FALSE(spdy_session_pool->HasSession(host_port_proxy_pair_)); | 262 EXPECT_FALSE(spdy_session_pool->HasSession(host_port_proxy_pair_)); |
263 session_ = spdy_session_pool->Get(host_port_proxy_pair_, BoundNetLog()); | 263 session_ = spdy_session_pool->Get(host_port_proxy_pair_, BoundNetLog()); |
264 EXPECT_TRUE(spdy_session_pool->HasSession(host_port_proxy_pair_)); | 264 EXPECT_TRUE(spdy_session_pool->HasSession(host_port_proxy_pair_)); |
265 transport_params_ = new TransportSocketParams(host_port_pair_, MEDIUM, | 265 transport_params_ = new TransportSocketParams(host_port_pair_, MEDIUM, |
266 GURL(), false, false); | 266 GURL(), false, false); |
267 TestOldCompletionCallback callback; | 267 TestOldCompletionCallback callback; |
268 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); | 268 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 EXPECT_EQ(OK, events[7].result); | 602 EXPECT_EQ(OK, events[7].result); |
603 | 603 |
604 // EOF close SPDY session. | 604 // EOF close SPDY session. |
605 EXPECT_TRUE(!http_session_->spdy_session_pool()->HasSession( | 605 EXPECT_TRUE(!http_session_->spdy_session_pool()->HasSession( |
606 host_port_proxy_pair_)); | 606 host_port_proxy_pair_)); |
607 EXPECT_TRUE(data()->at_read_eof()); | 607 EXPECT_TRUE(data()->at_read_eof()); |
608 EXPECT_TRUE(data()->at_write_eof()); | 608 EXPECT_TRUE(data()->at_write_eof()); |
609 } | 609 } |
610 | 610 |
611 } // namespace net | 611 } // namespace net |
OLD | NEW |