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_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 3013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3024 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PEER_GOING_AWAY, true)); | 3024 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PEER_GOING_AWAY, true)); |
3025 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0); | 3025 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0); |
3026 ProcessClosePacket(2, 0); | 3026 ProcessClosePacket(2, 0); |
3027 } | 3027 } |
3028 | 3028 |
3029 TEST_P(QuicConnectionTest, SendWhenDisconnected) { | 3029 TEST_P(QuicConnectionTest, SendWhenDisconnected) { |
3030 EXPECT_TRUE(connection_.connected()); | 3030 EXPECT_TRUE(connection_.connected()); |
3031 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PEER_GOING_AWAY, false)); | 3031 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_PEER_GOING_AWAY, false)); |
3032 connection_.CloseConnection(QUIC_PEER_GOING_AWAY, false); | 3032 connection_.CloseConnection(QUIC_PEER_GOING_AWAY, false); |
3033 EXPECT_FALSE(connection_.connected()); | 3033 EXPECT_FALSE(connection_.connected()); |
| 3034 EXPECT_FALSE(connection_.CanWriteStreamData()); |
3034 QuicPacket* packet = ConstructDataPacket(1, 0, !kEntropyFlag); | 3035 QuicPacket* packet = ConstructDataPacket(1, 0, !kEntropyFlag); |
3035 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, 1, _, _)).Times(0); | 3036 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, 1, _, _)).Times(0); |
3036 connection_.SendPacket( | 3037 connection_.SendPacket( |
3037 ENCRYPTION_NONE, 1, packet, kTestEntropyHash, HAS_RETRANSMITTABLE_DATA); | 3038 ENCRYPTION_NONE, 1, packet, kTestEntropyHash, HAS_RETRANSMITTABLE_DATA); |
3038 } | 3039 } |
3039 | 3040 |
3040 TEST_P(QuicConnectionTest, PublicReset) { | 3041 TEST_P(QuicConnectionTest, PublicReset) { |
3041 QuicPublicResetPacket header; | 3042 QuicPublicResetPacket header; |
3042 header.public_header.connection_id = connection_id_; | 3043 header.public_header.connection_id = connection_id_; |
3043 header.public_header.reset_flag = true; | 3044 header.public_header.reset_flag = true; |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3894 QuicBlockedFrame blocked; | 3895 QuicBlockedFrame blocked; |
3895 blocked.stream_id = 3; | 3896 blocked.stream_id = 3; |
3896 EXPECT_CALL(visitor_, OnBlockedFrames(_)); | 3897 EXPECT_CALL(visitor_, OnBlockedFrames(_)); |
3897 ProcessFramePacket(QuicFrame(&blocked)); | 3898 ProcessFramePacket(QuicFrame(&blocked)); |
3898 EXPECT_TRUE(ack_alarm->IsSet()); | 3899 EXPECT_TRUE(ack_alarm->IsSet()); |
3899 } | 3900 } |
3900 | 3901 |
3901 } // namespace | 3902 } // namespace |
3902 } // namespace test | 3903 } // namespace test |
3903 } // namespace net | 3904 } // namespace net |
OLD | NEW |