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/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 "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 SpdyWebSocketStreamTest() | 189 SpdyWebSocketStreamTest() |
190 : spdy_util_(GetParam()), | 190 : spdy_util_(GetParam()), |
191 spdy_settings_id_to_set_(SETTINGS_MAX_CONCURRENT_STREAMS), | 191 spdy_settings_id_to_set_(SETTINGS_MAX_CONCURRENT_STREAMS), |
192 spdy_settings_flags_to_set_(SETTINGS_FLAG_PLEASE_PERSIST), | 192 spdy_settings_flags_to_set_(SETTINGS_FLAG_PLEASE_PERSIST), |
193 spdy_settings_value_to_set_(1), | 193 spdy_settings_value_to_set_(1), |
194 session_deps_(GetParam()), | 194 session_deps_(GetParam()), |
195 stream_id_(0), | 195 stream_id_(0), |
196 created_stream_id_(0) {} | 196 created_stream_id_(0) {} |
197 virtual ~SpdyWebSocketStreamTest() {} | 197 virtual ~SpdyWebSocketStreamTest() {} |
198 | 198 |
199 virtual void SetUp() { | 199 void SetUp() override { |
200 host_port_pair_.set_host("example.com"); | 200 host_port_pair_.set_host("example.com"); |
201 host_port_pair_.set_port(80); | 201 host_port_pair_.set_port(80); |
202 spdy_session_key_ = SpdySessionKey(host_port_pair_, | 202 spdy_session_key_ = SpdySessionKey(host_port_pair_, |
203 ProxyServer::Direct(), | 203 ProxyServer::Direct(), |
204 PRIVACY_MODE_DISABLED); | 204 PRIVACY_MODE_DISABLED); |
205 | 205 |
206 spdy_settings_to_send_[spdy_settings_id_to_set_] = | 206 spdy_settings_to_send_[spdy_settings_id_to_set_] = |
207 SettingsFlagsAndValue( | 207 SettingsFlagsAndValue( |
208 SETTINGS_FLAG_PERSISTED, spdy_settings_value_to_set_); | 208 SETTINGS_FLAG_PERSISTED, spdy_settings_value_to_set_); |
209 } | 209 } |
210 | 210 |
211 virtual void TearDown() { | 211 void TearDown() override { base::MessageLoop::current()->RunUntilIdle(); } |
212 base::MessageLoop::current()->RunUntilIdle(); | |
213 } | |
214 | 212 |
215 void Prepare(SpdyStreamId stream_id) { | 213 void Prepare(SpdyStreamId stream_id) { |
216 stream_id_ = stream_id; | 214 stream_id_ = stream_id; |
217 | 215 |
218 request_frame_.reset(spdy_util_.ConstructSpdyWebSocketSynStream( | 216 request_frame_.reset(spdy_util_.ConstructSpdyWebSocketSynStream( |
219 stream_id_, | 217 stream_id_, |
220 "/echo", | 218 "/echo", |
221 "example.com", | 219 "example.com", |
222 "http://example.com/wsdemo")); | 220 "http://example.com/wsdemo")); |
223 | 221 |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 EXPECT_EQ(OK, events[7].result); | 660 EXPECT_EQ(OK, events[7].result); |
663 | 661 |
664 // EOF close SPDY session. | 662 // EOF close SPDY session. |
665 EXPECT_FALSE( | 663 EXPECT_FALSE( |
666 HasSpdySession(http_session_->spdy_session_pool(), spdy_session_key_)); | 664 HasSpdySession(http_session_->spdy_session_pool(), spdy_session_key_)); |
667 EXPECT_TRUE(data.at_read_eof()); | 665 EXPECT_TRUE(data.at_read_eof()); |
668 EXPECT_TRUE(data.at_write_eof()); | 666 EXPECT_TRUE(data.at_write_eof()); |
669 } | 667 } |
670 | 668 |
671 } // namespace net | 669 } // namespace net |
OLD | NEW |