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 <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 5356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5367 EXPECT_EQ(0u, session_->num_active_pushed_streams()); | 5367 EXPECT_EQ(0u, session_->num_active_pushed_streams()); |
5368 | 5368 |
5369 // Run until pushed stream is created. | 5369 // Run until pushed stream is created. |
5370 data.Resume(); | 5370 data.Resume(); |
5371 base::RunLoop().RunUntilIdle(); | 5371 base::RunLoop().RunUntilIdle(); |
5372 EXPECT_EQ(2u, session_->num_active_streams()); | 5372 EXPECT_EQ(2u, session_->num_active_streams()); |
5373 EXPECT_EQ(0u, session_->num_created_streams()); | 5373 EXPECT_EQ(0u, session_->num_created_streams()); |
5374 EXPECT_EQ(1u, session_->num_pushed_streams()); | 5374 EXPECT_EQ(1u, session_->num_pushed_streams()); |
5375 EXPECT_EQ(0u, session_->num_active_pushed_streams()); | 5375 EXPECT_EQ(0u, session_->num_active_pushed_streams()); |
5376 | 5376 |
5377 base::WeakPtr<SpdyStream> pushed_stream; | 5377 SpdyStream* pushed_stream; |
5378 int rv = session_->GetPushStream(GURL(kPushedUrl), IDLE, &pushed_stream, | 5378 int rv = session_->GetPushStream(GURL(kPushedUrl), IDLE, &pushed_stream, |
5379 NetLogWithSource()); | 5379 NetLogWithSource()); |
5380 ASSERT_THAT(rv, IsOk()); | 5380 ASSERT_THAT(rv, IsOk()); |
5381 ASSERT_TRUE(pushed_stream); | 5381 ASSERT_TRUE(pushed_stream); |
5382 test::StreamDelegateCloseOnHeaders delegate2(pushed_stream); | 5382 test::StreamDelegateCloseOnHeaders delegate2(pushed_stream->GetWeakPtr()); |
5383 pushed_stream->SetDelegate(&delegate2); | 5383 pushed_stream->SetDelegate(&delegate2); |
5384 | 5384 |
5385 // Receive headers for pushed stream. Delegate will cancel the stream, ensure | 5385 // Receive headers for pushed stream. Delegate will cancel the stream, ensure |
5386 // that all our counters are in consistent state. | 5386 // that all our counters are in consistent state. |
5387 data.Resume(); | 5387 data.Resume(); |
5388 base::RunLoop().RunUntilIdle(); | 5388 base::RunLoop().RunUntilIdle(); |
5389 EXPECT_EQ(1u, session_->num_active_streams()); | 5389 EXPECT_EQ(1u, session_->num_active_streams()); |
5390 EXPECT_EQ(0u, session_->num_created_streams()); | 5390 EXPECT_EQ(0u, session_->num_created_streams()); |
5391 EXPECT_EQ(0u, session_->num_pushed_streams()); | 5391 EXPECT_EQ(0u, session_->num_pushed_streams()); |
5392 EXPECT_EQ(0u, session_->num_active_pushed_streams()); | 5392 EXPECT_EQ(0u, session_->num_active_pushed_streams()); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5997 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), | 5997 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), |
5998 "spdy_pooling.pem"); | 5998 "spdy_pooling.pem"); |
5999 ssl_info.is_issued_by_known_root = true; | 5999 ssl_info.is_issued_by_known_root = true; |
6000 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); | 6000 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); |
6001 | 6001 |
6002 EXPECT_TRUE(SpdySession::CanPool( | 6002 EXPECT_TRUE(SpdySession::CanPool( |
6003 &tss, ssl_info, "www.example.org", "mail.example.org")); | 6003 &tss, ssl_info, "www.example.org", "mail.example.org")); |
6004 } | 6004 } |
6005 | 6005 |
6006 } // namespace net | 6006 } // namespace net |
OLD | NEW |