diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-08 19:01:52 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-08 19:01:52 +0000 |
commit | 14a957522e13fd223f1fb9af4b8e61f1c3351189 (patch) | |
tree | 579532bdece6b154af9c86f98547e1fa07ff1f76 /net/quic/quic_ack_notifier_test.cc | |
parent | bc14fb52b468bbde0d12276d44f70b943f86c697 (diff) | |
download | chromium_src-14a957522e13fd223f1fb9af4b8e61f1c3351189.zip chromium_src-14a957522e13fd223f1fb9af4b8e61f1c3351189.tar.gz chromium_src-14a957522e13fd223f1fb9af4b8e61f1c3351189.tar.bz2 |
Land Recent QUIC Changes.
Fix QUIC faster stats reporting memory leaks and crashes by changing
lifetime once again. Now QuicAckNotify::DelegateInterface, one of the
base classes of QuicFasterStatsGatherer, is ref-counted so
QuicFasterStatsGatherer is guanrateed to be around until either faster
stats reporting happens or the last ack is delivered by the
QuicConnection.
Merge internal change: 59228960
https://codereview.chromium.org/126543005/
Add a test requested by rch@ in cr/59053386 to replicate a potential
DCHECK failure.
Merge internal change: 59147972
https://codereview.chromium.org/127563002/
QUIC - Syncing with internal source code. Fixing the include
order. Added missing OVERRIDE.
Merge internal change: 59061118
https://codereview.chromium.org/127553002/
Make TimeWaitListManager use PacketWriter's socket writability state.
Merge internal change: 59058066
https://codereview.chromium.org/127523002/
Make QuicPacketWriter keep track of socket writability; expose the
underlying writer's state instead of keeping a separate variable in
Dispatcher.
Eventually we'll thread this to session/connection as suggested in
a TODO.
Merge internal change: 59055651
https://codereview.chromium.org/127503002/
Fix a QUIC DCHECK flakiness caused by not checking if a packet is
pending before asserting that it's in the sent_packet_map.
Merge internal change: 59053386
https://codereview.chromium.org/127003002/
QUIC Cleanup to remove pending_packets from QuicSentPacketManager and
use a flag in unacked_packets_.
Replaced FindOrNull and FindOrDie with find() call.
Merge internal change: 59015729
https://codereview.chromium.org/126983002/
R=rch@chromium.org
Review URL: https://codereview.chromium.org/127633002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_ack_notifier_test.cc')
-rw-r--r-- | net/quic/quic_ack_notifier_test.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/quic/quic_ack_notifier_test.cc b/net/quic/quic_ack_notifier_test.cc index 8facee3..c846d39 100644 --- a/net/quic/quic_ack_notifier_test.cc +++ b/net/quic/quic_ack_notifier_test.cc @@ -15,7 +15,8 @@ namespace { class QuicAckNotifierTest : public ::testing::Test { protected: virtual void SetUp() { - notifier_.reset(new QuicAckNotifier(&delegate_)); + delegate_ = new MockAckNotifierDelegate; + notifier_.reset(new QuicAckNotifier(delegate_)); sequence_numbers_.insert(26); sequence_numbers_.insert(99); @@ -24,13 +25,13 @@ class QuicAckNotifierTest : public ::testing::Test { } SequenceNumberSet sequence_numbers_; - MockAckNotifierDelegate delegate_; + MockAckNotifierDelegate* delegate_; scoped_ptr<QuicAckNotifier> notifier_; }; // Should trigger callback when we receive acks for all the registered seqnums. TEST_F(QuicAckNotifierTest, TriggerCallback) { - EXPECT_CALL(delegate_, OnAckNotification()).Times(1); + EXPECT_CALL(*delegate_, OnAckNotification()).Times(1); EXPECT_FALSE(notifier_->OnAck(26)); EXPECT_FALSE(notifier_->OnAck(99)); EXPECT_TRUE(notifier_->OnAck(1234)); @@ -39,7 +40,7 @@ TEST_F(QuicAckNotifierTest, TriggerCallback) { // Should not trigger callback if we never provide all the seqnums. TEST_F(QuicAckNotifierTest, DoesNotTrigger) { // Should not trigger callback as not all packets have been seen. - EXPECT_CALL(delegate_, OnAckNotification()).Times(0); + EXPECT_CALL(*delegate_, OnAckNotification()).Times(0); EXPECT_FALSE(notifier_->OnAck(26)); EXPECT_FALSE(notifier_->OnAck(99)); } @@ -51,7 +52,7 @@ TEST_F(QuicAckNotifierTest, UpdateSeqNums) { notifier_->UpdateSequenceNumber(99, 3000); notifier_->UpdateSequenceNumber(1234, 3001); - EXPECT_CALL(delegate_, OnAckNotification()).Times(1); + EXPECT_CALL(*delegate_, OnAckNotification()).Times(1); EXPECT_FALSE(notifier_->OnAck(26)); // original EXPECT_FALSE(notifier_->OnAck(3000)); // updated EXPECT_TRUE(notifier_->OnAck(3001)); // updated |