Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: net/quic/quic_connection_test.cc

Issue 550703003: Fix a flaky QUIC end_to_end_test when the socket was suddenly unwritable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_crash_bug_74792668
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_connection.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698