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

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

Issue 180013004: QUIC WINDOW_UPDATE and BLOCKED frames instigate ACKs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« 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 3728 matching lines...) Expand 10 before | Expand all | Expand 10 after
3739 ValueRestore<bool> old_flag(&FLAGS_enable_quic_pacing, true); 3739 ValueRestore<bool> old_flag(&FLAGS_enable_quic_pacing, true);
3740 3740
3741 TestConnection server(guid_, IPEndPoint(), helper_.get(), writer_.get(), 3741 TestConnection server(guid_, IPEndPoint(), helper_.get(), writer_.get(),
3742 true, version()); 3742 true, version());
3743 TestConnection client(guid_, IPEndPoint(), helper_.get(), writer_.get(), 3743 TestConnection client(guid_, IPEndPoint(), helper_.get(), writer_.get(),
3744 false, version()); 3744 false, version());
3745 EXPECT_TRUE(client.sent_packet_manager().using_pacing()); 3745 EXPECT_TRUE(client.sent_packet_manager().using_pacing());
3746 EXPECT_FALSE(server.sent_packet_manager().using_pacing()); 3746 EXPECT_FALSE(server.sent_packet_manager().using_pacing());
3747 } 3747 }
3748 3748
3749 TEST_P(QuicConnectionTest, ControlFramesInstigateAcks) {
3750 if (version() < QUIC_VERSION_14) {
3751 return;
3752 }
3753 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
3754
3755 // Send a WINDOW_UPDATE frame.
3756 QuicWindowUpdateFrame window_update;
3757 EXPECT_CALL(visitor_, OnWindowUpdateFrames(_));
3758 ProcessFramePacket(QuicFrame(&window_update));
3759
3760 // Ensure that this has caused the ACK alarm to be set.
3761 QuicAlarm* ack_alarm = QuicConnectionPeer::GetAckAlarm(&connection_);
3762 EXPECT_TRUE(ack_alarm->IsSet());
3763
3764 // Cancel alarm, and try again with BLOCKED frame.
3765 ack_alarm->Cancel();
3766 QuicBlockedFrame blocked;
3767 EXPECT_CALL(visitor_, OnBlockedFrames(_));
3768 ProcessFramePacket(QuicFrame(&blocked));
3769 EXPECT_TRUE(ack_alarm->IsSet());
3770 }
3771
3749 } // namespace 3772 } // namespace
3750 } // namespace test 3773 } // namespace test
3751 } // namespace net 3774 } // 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