| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_session_pool.h" | 5 #include "net/spdy/spdy_session_pool.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override {} | 86 void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override {} |
| 87 | 87 |
| 88 void OnDataSent() override {} | 88 void OnDataSent() override {} |
| 89 | 89 |
| 90 void OnTrailers(const SpdyHeaderBlock& trailers) override {} | 90 void OnTrailers(const SpdyHeaderBlock& trailers) override {} |
| 91 | 91 |
| 92 void OnClose(int status) override { | 92 void OnClose(int status) override { |
| 93 ignore_result(CreateFakeSpdySession(spdy_session_pool_, key_)); | 93 ignore_result(CreateFakeSpdySession(spdy_session_pool_, key_)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 NetLogSource source_dependency() const override { return NetLogSource(); } |
| 97 |
| 96 private: | 98 private: |
| 97 SpdySessionPool* const spdy_session_pool_; | 99 SpdySessionPool* const spdy_session_pool_; |
| 98 const SpdySessionKey key_; | 100 const SpdySessionKey key_; |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 // Set up a SpdyStream to create a new session when it is closed. | 103 // Set up a SpdyStream to create a new session when it is closed. |
| 102 // CloseCurrentSessions should not close the newly-created session. | 104 // CloseCurrentSessions should not close the newly-created session. |
| 103 TEST_F(SpdySessionPoolTest, CloseCurrentSessions) { | 105 TEST_F(SpdySessionPoolTest, CloseCurrentSessions) { |
| 104 const char kTestHost[] = "www.foo.com"; | 106 const char kTestHost[] = "www.foo.com"; |
| 105 const int kTestPort = 80; | 107 const int kTestPort = 80; |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 active_session_count_attr->GetString("value", &active_session_count)); | 894 active_session_count_attr->GetString("value", &active_session_count)); |
| 893 // No created stream so the session should be idle. | 895 // No created stream so the session should be idle. |
| 894 ASSERT_EQ("0", active_session_count); | 896 ASSERT_EQ("0", active_session_count); |
| 895 did_dump = true; | 897 did_dump = true; |
| 896 } | 898 } |
| 897 EXPECT_TRUE(did_dump); | 899 EXPECT_TRUE(did_dump); |
| 898 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); | 900 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); |
| 899 } | 901 } |
| 900 | 902 |
| 901 } // namespace net | 903 } // namespace net |
| OLD | NEW |