| 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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 3182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3193 StreamClosingDelegate(const base::WeakPtr<SpdyStream>& stream, | 3193 StreamClosingDelegate(const base::WeakPtr<SpdyStream>& stream, |
| 3194 base::StringPiece data) | 3194 base::StringPiece data) |
| 3195 : StreamDelegateWithBody(stream, data) {} | 3195 : StreamDelegateWithBody(stream, data) {} |
| 3196 | 3196 |
| 3197 virtual ~StreamClosingDelegate() {} | 3197 virtual ~StreamClosingDelegate() {} |
| 3198 | 3198 |
| 3199 void set_stream_to_close(const base::WeakPtr<SpdyStream>& stream_to_close) { | 3199 void set_stream_to_close(const base::WeakPtr<SpdyStream>& stream_to_close) { |
| 3200 stream_to_close_ = stream_to_close; | 3200 stream_to_close_ = stream_to_close; |
| 3201 } | 3201 } |
| 3202 | 3202 |
| 3203 virtual int OnSendBody() OVERRIDE { | 3203 virtual void OnSendBody() OVERRIDE { |
| 3204 int rv = test::StreamDelegateWithBody::OnSendBody(); | 3204 test::StreamDelegateWithBody::OnSendBody(); |
| 3205 if (stream_to_close_) { | 3205 if (stream_to_close_) { |
| 3206 stream_to_close_->Close(); | 3206 stream_to_close_->Close(); |
| 3207 EXPECT_EQ(NULL, stream_to_close_.get()); | 3207 EXPECT_EQ(NULL, stream_to_close_.get()); |
| 3208 } | 3208 } |
| 3209 return rv; | |
| 3210 } | 3209 } |
| 3211 | 3210 |
| 3212 private: | 3211 private: |
| 3213 base::WeakPtr<SpdyStream> stream_to_close_; | 3212 base::WeakPtr<SpdyStream> stream_to_close_; |
| 3214 }; | 3213 }; |
| 3215 | 3214 |
| 3216 // Cause a stall by reducing the flow control send window to | 3215 // Cause a stall by reducing the flow control send window to |
| 3217 // 0. Unstalling the session should properly handle deleted streams. | 3216 // 0. Unstalling the session should properly handle deleted streams. |
| 3218 TEST_F(SpdySessionSpdy3Test, SendWindowSizeIncreaseWithDeletedStreams31) { | 3217 TEST_F(SpdySessionSpdy3Test, SendWindowSizeIncreaseWithDeletedStreams31) { |
| 3219 const char kStreamUrl[] = "http://www.google.com/"; | 3218 const char kStreamUrl[] = "http://www.google.com/"; |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3718 spdy_session_pool_->Remove(session_privacy_enabled); | 3717 spdy_session_pool_->Remove(session_privacy_enabled); |
| 3719 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_enabled)); | 3718 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_enabled)); |
| 3720 EXPECT_TRUE(spdy_session_pool_->HasSession(key_privacy_disabled)); | 3719 EXPECT_TRUE(spdy_session_pool_->HasSession(key_privacy_disabled)); |
| 3721 | 3720 |
| 3722 spdy_session_pool_->Remove(session_privacy_disabled); | 3721 spdy_session_pool_->Remove(session_privacy_disabled); |
| 3723 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_enabled)); | 3722 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_enabled)); |
| 3724 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_disabled)); | 3723 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_disabled)); |
| 3725 } | 3724 } |
| 3726 | 3725 |
| 3727 } // namespace net | 3726 } // namespace net |
| OLD | NEW |