Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 | 507 |
| 508 TEST_P(SpdySessionPoolTest, IPPoolingCloseIdleSessions) { | 508 TEST_P(SpdySessionPoolTest, IPPoolingCloseIdleSessions) { |
| 509 RunIPPoolingTest(SPDY_POOL_CLOSE_IDLE_SESSIONS); | 509 RunIPPoolingTest(SPDY_POOL_CLOSE_IDLE_SESSIONS); |
| 510 } | 510 } |
| 511 | 511 |
| 512 // Construct a Pool with SpdySessions in various availability states. Simulate | 512 // Construct a Pool with SpdySessions in various availability states. Simulate |
| 513 // an IP address change. Ensure sessions gracefully shut down. Regression test | 513 // an IP address change. Ensure sessions gracefully shut down. Regression test |
| 514 // for crbug.com/379469. | 514 // for crbug.com/379469. |
| 515 TEST_P(SpdySessionPoolTest, IPAddressChanged) { | 515 TEST_P(SpdySessionPoolTest, IPAddressChanged) { |
| 516 MockConnect connect_data(SYNCHRONOUS, OK); | 516 MockConnect connect_data(SYNCHRONOUS, OK); |
| 517 session_deps_.host_resolver->set_synchronous_mode(true); | |
| 518 | 517 |
| 519 // This isn't testing anything having to do with SPDY frames; we | 518 // This isn't testing anything having to do with SPDY frames; we |
| 520 // can ignore issues of how dependencies are set. We default to | 519 // can ignore issues of how dependencies are set. We default to |
| 521 // setting them (when doing the appropriate protocol) since that's | 520 // setting them (when doing the appropriate protocol) since that's |
| 522 // where we're eventually headed for all HTTP/2 connections. | 521 // where we're eventually headed for all HTTP/2 connections. |
| 522 session_deps_.host_resolver->set_synchronous_mode(true); | |
|
Bence
2016/03/17 01:48:59
Why did you move the synchronous line below the co
Randy Smith (Not in Mondays)
2016/03/17 20:27:42
Whoops, sorry, I think I misread it and thought it
| |
| 523 session_deps_.enable_priority_dependencies = true; | |
|
Bence
2016/03/17 01:48:59
Optional: const bool enable_priority_dependencies
Bence
2016/03/17 12:25:59
I guess I mean
const bool enable_priority_depende
Randy Smith (Not in Mondays)
2016/03/17 20:27:42
I took the comment option.
| |
| 523 SpdyTestUtil spdy_util(GetParam(), true); | 524 SpdyTestUtil spdy_util(GetParam(), true); |
| 524 SpdySession::SetPriorityDependencyDefaultForTesting(true); | |
| 525 | 525 |
| 526 MockRead reads[] = { | 526 MockRead reads[] = { |
| 527 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. | 527 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. |
| 528 }; | 528 }; |
| 529 scoped_ptr<SpdyFrame> req( | 529 scoped_ptr<SpdyFrame> req( |
| 530 spdy_util.ConstructSpdyGet("http://www.a.com", 1, MEDIUM)); | 530 spdy_util.ConstructSpdyGet("http://www.a.com", 1, MEDIUM)); |
| 531 MockWrite writes[] = {CreateMockWrite(*req, 1)}; | 531 MockWrite writes[] = {CreateMockWrite(*req, 1)}; |
| 532 | 532 |
| 533 StaticSocketDataProvider dataA(reads, arraysize(reads), writes, | 533 StaticSocketDataProvider dataA(reads, arraysize(reads), writes, |
| 534 arraysize(writes)); | 534 arraysize(writes)); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 623 EXPECT_TRUE(sessionA->IsDraining()); | 623 EXPECT_TRUE(sessionA->IsDraining()); |
| 624 EXPECT_TRUE(sessionB->IsDraining()); | 624 EXPECT_TRUE(sessionB->IsDraining()); |
| 625 EXPECT_TRUE(sessionC->IsDraining()); | 625 EXPECT_TRUE(sessionC->IsDraining()); |
| 626 | 626 |
| 627 // Both streams were closed with an error. | 627 // Both streams were closed with an error. |
| 628 EXPECT_TRUE(delegateA.StreamIsClosed()); | 628 EXPECT_TRUE(delegateA.StreamIsClosed()); |
| 629 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); | 629 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); |
| 630 EXPECT_TRUE(delegateB.StreamIsClosed()); | 630 EXPECT_TRUE(delegateB.StreamIsClosed()); |
| 631 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); | 631 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); |
| 632 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 632 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
| 633 SpdySession::SetPriorityDependencyDefaultForTesting(false); | |
| 634 } | 633 } |
| 635 | 634 |
| 636 } // namespace net | 635 } // namespace net |
| OLD | NEW |