| 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/quic/quic_session.h" | 5 #include "net/quic/quic_session.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 TEST_P(QuicSessionTest, DoNotSendGoAwayTwice) { | 574 TEST_P(QuicSessionTest, DoNotSendGoAwayTwice) { |
| 575 EXPECT_CALL(*connection_, | 575 EXPECT_CALL(*connection_, |
| 576 SendGoAway(QUIC_PEER_GOING_AWAY, 0u, "Going Away.")).Times(1); | 576 SendGoAway(QUIC_PEER_GOING_AWAY, 0u, "Going Away.")).Times(1); |
| 577 session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); | 577 session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); |
| 578 EXPECT_TRUE(session_.goaway_sent()); | 578 EXPECT_TRUE(session_.goaway_sent()); |
| 579 session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); | 579 session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); |
| 580 } | 580 } |
| 581 | 581 |
| 582 TEST_P(QuicSessionTest, IncreasedTimeoutAfterCryptoHandshake) { | 582 TEST_P(QuicSessionTest, IncreasedTimeoutAfterCryptoHandshake) { |
| 583 EXPECT_EQ((FLAGS_quic_unified_timeouts ? | 583 EXPECT_EQ((FLAGS_quic_unified_timeouts ? |
| 584 kInitialIdleTimeoutSecs : kDefaultIdleTimeoutSecs) + 1, | 584 kInitialIdleTimeoutSecs : kDefaultIdleTimeoutSecs) + 3, |
| 585 QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); | 585 QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); |
| 586 CryptoHandshakeMessage msg; | 586 CryptoHandshakeMessage msg; |
| 587 session_.GetCryptoStream()->OnHandshakeMessage(msg); | 587 session_.GetCryptoStream()->OnHandshakeMessage(msg); |
| 588 EXPECT_EQ(kMaximumIdleTimeoutSecs + 1, | 588 EXPECT_EQ(kMaximumIdleTimeoutSecs + 3, |
| 589 QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); | 589 QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); |
| 590 } | 590 } |
| 591 | 591 |
| 592 TEST_P(QuicSessionTest, RstStreamBeforeHeadersDecompressed) { | 592 TEST_P(QuicSessionTest, RstStreamBeforeHeadersDecompressed) { |
| 593 // Send two bytes of payload. | 593 // Send two bytes of payload. |
| 594 QuicStreamFrame data1(kClientDataStreamId1, false, 0, MakeIOVector("HT")); | 594 QuicStreamFrame data1(kClientDataStreamId1, false, 0, MakeIOVector("HT")); |
| 595 vector<QuicStreamFrame> frames; | 595 vector<QuicStreamFrame> frames; |
| 596 frames.push_back(data1); | 596 frames.push_back(data1); |
| 597 session_.OnStreamFrames(frames); | 597 session_.OnStreamFrames(frames); |
| 598 EXPECT_EQ(1u, session_.GetNumOpenStreams()); | 598 EXPECT_EQ(1u, session_.GetNumOpenStreams()); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 } | 1025 } |
| 1026 | 1026 |
| 1027 // Called after any new data is received by the session, and triggers the call | 1027 // Called after any new data is received by the session, and triggers the call |
| 1028 // to close the connection. | 1028 // to close the connection. |
| 1029 session_.PostProcessAfterData(); | 1029 session_.PostProcessAfterData(); |
| 1030 } | 1030 } |
| 1031 | 1031 |
| 1032 } // namespace | 1032 } // namespace |
| 1033 } // namespace test | 1033 } // namespace test |
| 1034 } // namespace net | 1034 } // namespace net |
| OLD | NEW |