| 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 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2687 // A delegate that drops any received data. | 2687 // A delegate that drops any received data. |
| 2688 class DropReceivedDataDelegate : public test::StreamDelegateSendImmediate { | 2688 class DropReceivedDataDelegate : public test::StreamDelegateSendImmediate { |
| 2689 public: | 2689 public: |
| 2690 DropReceivedDataDelegate(const base::WeakPtr<SpdyStream>& stream, | 2690 DropReceivedDataDelegate(const base::WeakPtr<SpdyStream>& stream, |
| 2691 base::StringPiece data) | 2691 base::StringPiece data) |
| 2692 : StreamDelegateSendImmediate(stream, data) {} | 2692 : StreamDelegateSendImmediate(stream, data) {} |
| 2693 | 2693 |
| 2694 virtual ~DropReceivedDataDelegate() {} | 2694 virtual ~DropReceivedDataDelegate() {} |
| 2695 | 2695 |
| 2696 // Drop any received data. | 2696 // Drop any received data. |
| 2697 virtual int OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE { | 2697 virtual void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) OVERRIDE {} |
| 2698 return OK; | |
| 2699 } | |
| 2700 }; | 2698 }; |
| 2701 | 2699 |
| 2702 // Send data back and forth but use a delegate that drops its received | 2700 // Send data back and forth but use a delegate that drops its received |
| 2703 // data. The receive window should still increase to its original | 2701 // data. The receive window should still increase to its original |
| 2704 // value, i.e. we shouldn't "leak" receive window bytes. | 2702 // value, i.e. we shouldn't "leak" receive window bytes. |
| 2705 TEST_P(SpdySessionTest, SessionFlowControlNoReceiveLeaks) { | 2703 TEST_P(SpdySessionTest, SessionFlowControlNoReceiveLeaks) { |
| 2706 if (GetParam() < kProtoSPDY31) | 2704 if (GetParam() < kProtoSPDY31) |
| 2707 return; | 2705 return; |
| 2708 | 2706 |
| 2709 const char kStreamUrl[] = "http://www.google.com/"; | 2707 const char kStreamUrl[] = "http://www.google.com/"; |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3955 spdy_session_pool_->Remove(session_privacy_enabled); | 3953 spdy_session_pool_->Remove(session_privacy_enabled); |
| 3956 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_enabled)); | 3954 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_enabled)); |
| 3957 EXPECT_TRUE(spdy_session_pool_->HasSession(key_privacy_disabled)); | 3955 EXPECT_TRUE(spdy_session_pool_->HasSession(key_privacy_disabled)); |
| 3958 | 3956 |
| 3959 spdy_session_pool_->Remove(session_privacy_disabled); | 3957 spdy_session_pool_->Remove(session_privacy_disabled); |
| 3960 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_enabled)); | 3958 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_enabled)); |
| 3961 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_disabled)); | 3959 EXPECT_FALSE(spdy_session_pool_->HasSession(key_privacy_disabled)); |
| 3962 } | 3960 } |
| 3963 | 3961 |
| 3964 } // namespace net | 3962 } // namespace net |
| OLD | NEW |