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

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

Issue 478153003: Change the wire format of the ack frame to include a compressed version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase TOT and pass clock to QuicTestPacketMaker and use it in AckPacket 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_logger.cc ('k') | net/quic/quic_framer.h » ('j') | 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 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 2561
2562 TEST_P(QuicConnectionTest, NoQuicCongestionFeedbackFrame) { 2562 TEST_P(QuicConnectionTest, NoQuicCongestionFeedbackFrame) {
2563 SendAckPacketToPeer(); 2563 SendAckPacketToPeer();
2564 EXPECT_TRUE(writer_->feedback_frames().empty()); 2564 EXPECT_TRUE(writer_->feedback_frames().empty());
2565 } 2565 }
2566 2566
2567 TEST_P(QuicConnectionTest, WithQuicCongestionFeedbackFrame) { 2567 TEST_P(QuicConnectionTest, WithQuicCongestionFeedbackFrame) {
2568 QuicCongestionFeedbackFrame info; 2568 QuicCongestionFeedbackFrame info;
2569 info.type = kTCP; 2569 info.type = kTCP;
2570 info.tcp.receive_window = 0x4030; 2570 info.tcp.receive_window = 0x4030;
2571 SetFeedback(&info);
2572 2571
2573 SendAckPacketToPeer(); 2572 // After QUIC_VERSION_22, do not send TCP Congestion Feedback Frames anymore.
2574 ASSERT_FALSE(writer_->feedback_frames().empty()); 2573 if (version() > QUIC_VERSION_22) {
2575 ASSERT_EQ(kTCP, writer_->feedback_frames()[0].type); 2574 SendAckPacketToPeer();
2575 ASSERT_TRUE(writer_->feedback_frames().empty());
2576 } else {
2577 // Only SetFeedback in this case because SetFeedback will create a receive
2578 // algorithm which is how the received_packet_manager checks if it should be
2579 // creating TCP Congestion Feedback Frames.
2580 SetFeedback(&info);
2581 SendAckPacketToPeer();
2582 ASSERT_FALSE(writer_->feedback_frames().empty());
2583 ASSERT_EQ(kTCP, writer_->feedback_frames()[0].type);
2584 }
2576 } 2585 }
2577 2586
2578 TEST_P(QuicConnectionTest, UpdateQuicCongestionFeedbackFrame) { 2587 TEST_P(QuicConnectionTest, UpdateQuicCongestionFeedbackFrame) {
2579 SendAckPacketToPeer(); 2588 SendAckPacketToPeer();
2580 EXPECT_CALL(*receive_algorithm_, RecordIncomingPacket(_, _, _)); 2589 EXPECT_CALL(*receive_algorithm_, RecordIncomingPacket(_, _, _));
2581 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); 2590 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
2582 ProcessPacket(1); 2591 ProcessPacket(1);
2583 } 2592 }
2584 2593
2585 TEST_P(QuicConnectionTest, DontUpdateQuicCongestionFeedbackFrameForRevived) { 2594 TEST_P(QuicConnectionTest, DontUpdateQuicCongestionFeedbackFrameForRevived) {
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
3954 QuicBlockedFrame blocked; 3963 QuicBlockedFrame blocked;
3955 blocked.stream_id = 3; 3964 blocked.stream_id = 3;
3956 EXPECT_CALL(visitor_, OnBlockedFrames(_)); 3965 EXPECT_CALL(visitor_, OnBlockedFrames(_));
3957 ProcessFramePacket(QuicFrame(&blocked)); 3966 ProcessFramePacket(QuicFrame(&blocked));
3958 EXPECT_TRUE(ack_alarm->IsSet()); 3967 EXPECT_TRUE(ack_alarm->IsSet());
3959 } 3968 }
3960 3969
3961 } // namespace 3970 } // namespace
3962 } // namespace test 3971 } // namespace test
3963 } // namespace net 3972 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_logger.cc ('k') | net/quic/quic_framer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698