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

Unified Diff: net/quic/quic_ack_notifier_test.cc

Issue 127633002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_ack_notifier.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_ack_notifier_test.cc
diff --git a/net/quic/quic_ack_notifier_test.cc b/net/quic/quic_ack_notifier_test.cc
index 8facee340f00f3ea3382b1d4af7895735af77918..c846d39bf6e0fc5813d680ca3f45d4d872f5fae9 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
« no previous file with comments | « net/quic/quic_ack_notifier.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698