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

Unified Diff: net/quic/quic_ack_notifier_test.cc

Issue 198353003: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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_manager.cc ('k') | net/quic/quic_connection.h » ('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 c846d39bf6e0fc5813d680ca3f45d4d872f5fae9..c05e63ecb72af62a7c2a6421fb0640e97c4fc01f 100644
--- a/net/quic/quic_ack_notifier_test.cc
+++ b/net/quic/quic_ack_notifier_test.cc
@@ -8,6 +8,8 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+using testing::_;
+
namespace net {
namespace test {
namespace {
@@ -18,20 +20,18 @@ class QuicAckNotifierTest : public ::testing::Test {
delegate_ = new MockAckNotifierDelegate;
notifier_.reset(new QuicAckNotifier(delegate_));
- sequence_numbers_.insert(26);
- sequence_numbers_.insert(99);
- sequence_numbers_.insert(1234);
- notifier_->AddSequenceNumbers(sequence_numbers_);
+ notifier_->AddSequenceNumber(26, 100);
+ notifier_->AddSequenceNumber(99, 20);
+ notifier_->AddSequenceNumber(1234, 3);
}
- SequenceNumberSet sequence_numbers_;
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(3, 123, 0, 0)).Times(1);
EXPECT_FALSE(notifier_->OnAck(26));
EXPECT_FALSE(notifier_->OnAck(99));
EXPECT_TRUE(notifier_->OnAck(1234));
@@ -40,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));
}
@@ -52,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(3, 123, 2, 20 + 3)).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_manager.cc ('k') | net/quic/quic_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698