| 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 <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 4634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4645 EXPECT_CALL(*listener, OnPacketAcked(_, _)).Times(1); | 4645 EXPECT_CALL(*listener, OnPacketAcked(_, _)).Times(1); |
| 4646 // Send some data, which will register the listener to be notified. | 4646 // Send some data, which will register the listener to be notified. |
| 4647 connection_.SendStreamDataWithString(1, "foo", 0, !kFin, listener.get()); | 4647 connection_.SendStreamDataWithString(1, "foo", 0, !kFin, listener.get()); |
| 4648 connection_.SendStreamDataWithString(2, "bar", 0, !kFin, nullptr); | 4648 connection_.SendStreamDataWithString(2, "bar", 0, !kFin, nullptr); |
| 4649 | 4649 |
| 4650 // Process an ACK from the server with a revived packet, which should trigger | 4650 // Process an ACK from the server with a revived packet, which should trigger |
| 4651 // the callback. | 4651 // the callback. |
| 4652 EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _)); | 4652 EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _)); |
| 4653 QuicAckFrame frame = InitAckFrame(2); | 4653 QuicAckFrame frame = InitAckFrame(2); |
| 4654 NackPacket(1, &frame); | 4654 NackPacket(1, &frame); |
| 4655 frame.revived_packets.insert(1); | 4655 frame.latest_revived_packet = 1; |
| 4656 ProcessAckPacket(&frame); | 4656 ProcessAckPacket(&frame); |
| 4657 // If the ack is processed again, the notifier should not be called again. | 4657 // If the ack is processed again, the notifier should not be called again. |
| 4658 ProcessAckPacket(&frame); | 4658 ProcessAckPacket(&frame); |
| 4659 } | 4659 } |
| 4660 | 4660 |
| 4661 TEST_P(QuicConnectionTest, AckNotifierCallbackAfterFECRecovery) { | 4661 TEST_P(QuicConnectionTest, AckNotifierCallbackAfterFECRecovery) { |
| 4662 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); | 4662 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); |
| 4663 EXPECT_CALL(visitor_, OnCanWrite()); | 4663 EXPECT_CALL(visitor_, OnCanWrite()); |
| 4664 | 4664 |
| 4665 // Create a listener which we expect to be called. | 4665 // Create a listener which we expect to be called. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4841 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1); | 4841 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1); |
| 4842 connection_.SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, "Going Away."); | 4842 connection_.SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, "Going Away."); |
| 4843 EXPECT_TRUE(connection_.goaway_sent()); | 4843 EXPECT_TRUE(connection_.goaway_sent()); |
| 4844 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0); | 4844 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0); |
| 4845 connection_.SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, "Going Away."); | 4845 connection_.SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, "Going Away."); |
| 4846 } | 4846 } |
| 4847 | 4847 |
| 4848 } // namespace | 4848 } // namespace |
| 4849 } // namespace test | 4849 } // namespace test |
| 4850 } // namespace net | 4850 } // namespace net |
| OLD | NEW |