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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "net/spdy/spdy_stream.h" | 6 #include "net/spdy/spdy_stream.h" |
7 #include "net/spdy/spdy_http_utils.h" | 7 #include "net/spdy/spdy_http_utils.h" |
8 #include "net/spdy/spdy_session.h" | 8 #include "net/spdy/spdy_session.h" |
9 #include "net/spdy/spdy_test_util.h" | 9 #include "net/spdy/spdy_test_util.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 | 13 |
14 // TODO(ukai): factor out common part with spdy_http_stream_unittest.cc | |
15 class SpdySessionPoolPeer { | |
16 public: | |
17 explicit SpdySessionPoolPeer(SpdySessionPool* pool) | |
18 : pool_(pool) {} | |
19 | |
20 void RemoveSpdySession(const scoped_refptr<SpdySession>& session) { | |
21 pool_->Remove(session); | |
22 } | |
23 | |
24 private: | |
25 SpdySessionPool* const pool_; | |
26 | |
27 DISALLOW_COPY_AND_ASSIGN(SpdySessionPoolPeer); | |
28 }; | |
29 | |
30 namespace { | 14 namespace { |
31 | 15 |
32 class TestSpdyStreamDelegate : public SpdyStream::Delegate { | 16 class TestSpdyStreamDelegate : public SpdyStream::Delegate { |
33 public: | 17 public: |
34 TestSpdyStreamDelegate(SpdyStream* stream, | 18 TestSpdyStreamDelegate(SpdyStream* stream, |
35 IOBufferWithSize* buf, | 19 IOBufferWithSize* buf, |
36 CompletionCallback* callback) | 20 CompletionCallback* callback) |
37 : stream_(stream), | 21 : stream_(stream), |
38 buf_(buf), | 22 buf_(buf), |
39 callback_(callback), | 23 callback_(callback), |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 stream->OnHeaders(headers); | 259 stream->OnHeaders(headers); |
276 | 260 |
277 stream->set_response_received(); | 261 stream->set_response_received(); |
278 EXPECT_TRUE(stream->response_received()); | 262 EXPECT_TRUE(stream->response_received()); |
279 EXPECT_TRUE(stream->HasUrl()); | 263 EXPECT_TRUE(stream->HasUrl()); |
280 EXPECT_EQ(kStreamUrl, stream->GetUrl().spec()); | 264 EXPECT_EQ(kStreamUrl, stream->GetUrl().spec()); |
281 } | 265 } |
282 | 266 |
283 | 267 |
284 } // namespace net | 268 } // namespace net |
OLD | NEW |