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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "net/base/completion_callback.h" | 6 #include "net/base/completion_callback.h" |
7 #include "net/base/net_log_unittest.h" | 7 #include "net/base/net_log_unittest.h" |
8 #include "net/spdy/buffered_spdy_framer.h" | 8 #include "net/spdy/buffered_spdy_framer.h" |
9 #include "net/spdy/spdy_stream.h" | 9 #include "net/spdy/spdy_stream.h" |
10 #include "net/spdy/spdy_http_utils.h" | 10 #include "net/spdy/spdy_http_utils.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 | 99 |
100 } // anonymous namespace | 100 } // anonymous namespace |
101 | 101 |
102 class SpdyStreamSpdy2Test : public testing::Test { | 102 class SpdyStreamSpdy2Test : public testing::Test { |
103 protected: | 103 protected: |
104 SpdyStreamSpdy2Test() { | 104 SpdyStreamSpdy2Test() { |
105 } | 105 } |
106 | 106 |
107 scoped_refptr<SpdySession> CreateSpdySession() { | 107 scoped_refptr<SpdySession> CreateSpdySession() { |
108 spdy::SpdyFramer::set_enable_compression_default(false); | |
109 HostPortPair host_port_pair("www.google.com", 80); | 108 HostPortPair host_port_pair("www.google.com", 80); |
110 HostPortProxyPair pair(host_port_pair, ProxyServer::Direct()); | 109 HostPortProxyPair pair(host_port_pair, ProxyServer::Direct()); |
111 scoped_refptr<SpdySession> session( | 110 scoped_refptr<SpdySession> session( |
112 session_->spdy_session_pool()->Get(pair, BoundNetLog())); | 111 session_->spdy_session_pool()->Get(pair, BoundNetLog())); |
113 return session; | 112 return session; |
114 } | 113 } |
115 | 114 |
116 virtual void SetUp() { | 115 virtual void SetUp() { |
117 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY2); | 116 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY2); |
118 } | 117 } |
119 | 118 |
120 virtual void TearDown() { | 119 virtual void TearDown() { |
121 MessageLoop::current()->RunAllPending(); | 120 MessageLoop::current()->RunAllPending(); |
122 } | 121 } |
123 | 122 |
124 scoped_refptr<HttpNetworkSession> session_; | 123 scoped_refptr<HttpNetworkSession> session_; |
| 124 |
| 125 private: |
| 126 SpdyTestStateHelper spdy_state_; |
125 }; | 127 }; |
126 | 128 |
127 TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) { | 129 TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) { |
128 SpdySessionDependencies session_deps; | 130 SpdySessionDependencies session_deps; |
129 | 131 |
130 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps); | 132 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps); |
131 SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); | 133 SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); |
132 | 134 |
133 const SpdyHeaderInfo kSynStartHeader = { | 135 const SpdyHeaderInfo kSynStartHeader = { |
134 spdy::SYN_STREAM, | 136 spdy::SYN_STREAM, |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 net::NetLog::PHASE_NONE); | 427 net::NetLog::PHASE_NONE); |
426 | 428 |
427 CapturingNetLog::Entry entry = entries[pos]; | 429 CapturingNetLog::Entry entry = entries[pos]; |
428 NetLogSpdyStreamErrorParameter* request_params = | 430 NetLogSpdyStreamErrorParameter* request_params = |
429 static_cast<NetLogSpdyStreamErrorParameter*>( | 431 static_cast<NetLogSpdyStreamErrorParameter*>( |
430 entry.extra_parameters.get()); | 432 entry.extra_parameters.get()); |
431 EXPECT_EQ(stream_id, request_params->stream_id()); | 433 EXPECT_EQ(stream_id, request_params->stream_id()); |
432 } | 434 } |
433 | 435 |
434 } // namespace net | 436 } // namespace net |
OLD | NEW |