| 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); | 517 session_deps_.host_resolver->set_synchronous_mode(true); |
| 518 | 518 |
| 519 // This isn't testing anything having to do with SPDY frames; we | 519 // This isn't testing anything having to do with SPDY frames; we |
| 520 // can ignore issues of how dependencies are set. We default to | 520 // can ignore issues of how dependencies are set. We default to |
| 521 // setting them (when doing the appropriate protocol) since that's | 521 // setting them (when doing the appropriate protocol) since that's |
| 522 // where we're eventually headed for all HTTP/2 connections. | 522 // where we're eventually headed for all HTTP/2 connections. |
| 523 SpdyTestUtil spdy_util(GetParam(), true); | 523 SpdyTestUtil spdy_util(GetParam(), true); |
| 524 SpdySession::SetPriorityDependencyDefaultForTesting(true); | 524 bool old_dependency_default = |
| 525 Http2PriorityDependencies::SetEnabledDefaultForTesting(true); |
| 525 | 526 |
| 526 MockRead reads[] = { | 527 MockRead reads[] = { |
| 527 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. | 528 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. |
| 528 }; | 529 }; |
| 529 scoped_ptr<SpdyFrame> req( | 530 scoped_ptr<SpdyFrame> req( |
| 530 spdy_util.ConstructSpdyGet("http://www.a.com", 1, MEDIUM)); | 531 spdy_util.ConstructSpdyGet("http://www.a.com", 1, MEDIUM)); |
| 531 MockWrite writes[] = {CreateMockWrite(*req, 1)}; | 532 MockWrite writes[] = {CreateMockWrite(*req, 1)}; |
| 532 | 533 |
| 533 StaticSocketDataProvider dataA(reads, arraysize(reads), writes, | 534 StaticSocketDataProvider dataA(reads, arraysize(reads), writes, |
| 534 arraysize(writes)); | 535 arraysize(writes)); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 EXPECT_TRUE(sessionA->IsDraining()); | 624 EXPECT_TRUE(sessionA->IsDraining()); |
| 624 EXPECT_TRUE(sessionB->IsDraining()); | 625 EXPECT_TRUE(sessionB->IsDraining()); |
| 625 EXPECT_TRUE(sessionC->IsDraining()); | 626 EXPECT_TRUE(sessionC->IsDraining()); |
| 626 | 627 |
| 627 // Both streams were closed with an error. | 628 // Both streams were closed with an error. |
| 628 EXPECT_TRUE(delegateA.StreamIsClosed()); | 629 EXPECT_TRUE(delegateA.StreamIsClosed()); |
| 629 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); | 630 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); |
| 630 EXPECT_TRUE(delegateB.StreamIsClosed()); | 631 EXPECT_TRUE(delegateB.StreamIsClosed()); |
| 631 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); | 632 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); |
| 632 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 633 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
| 633 SpdySession::SetPriorityDependencyDefaultForTesting(false); | 634 Http2PriorityDependencies::SetEnabledDefaultForTesting( |
| 635 old_dependency_default); |
| 634 } | 636 } |
| 635 | 637 |
| 636 } // namespace net | 638 } // namespace net |
| OLD | NEW |