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

Unified Diff: net/tools/quic/quic_dispatcher_test.cc

Issue 2391103003: Landing Recent QUIC changes until 3:24 PM, Oct 01, 2016 UTC-4 (Closed)
Patch Set: Add new error code to quic_error_mapping.cc Created 4 years, 2 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/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher_test.cc
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index 1d7343f56f455a3387cc14b7752c868acc3650e6..23ca8797bae3c0983d7d0a0fe62175ddb767c62d 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -1374,7 +1374,7 @@ TEST_P(BufferedPacketStoreTest, ProcessCHLOsUptoLimitAndBufferTheRest) {
}
// Duplicated CHLO shouldn't be buffered.
-TEST_P(BufferedPacketStoreTest, DropDuplicatedCHLO) {
+TEST_P(BufferedPacketStoreTest, BufferDuplicatedCHLO) {
FLAGS_quic_limit_num_new_sessions_per_epoll_loop = true;
for (QuicConnectionId conn_id = 1; conn_id <= kMaxNumSessionsToCreate + 1;
++conn_id) {
@@ -1399,6 +1399,12 @@ TEST_P(BufferedPacketStoreTest, DropDuplicatedCHLO) {
ProcessPacket(client_addr_, last_connection, true, false,
SerializeFullCHLO());
+ size_t packets_buffered = 2;
+ if (!FLAGS_quic_buffer_packets_after_chlo) {
+ // The packet sent above is dropped when flag is off.
+ packets_buffered = 1;
+ }
+
// Reset counter and process buffered CHLO.
EXPECT_CALL(*dispatcher_, CreateQuicSession(last_connection, client_addr_))
.WillOnce(testing::Return(CreateSession(
@@ -1408,7 +1414,8 @@ TEST_P(BufferedPacketStoreTest, DropDuplicatedCHLO) {
// Only one packet(CHLO) should be process.
EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()),
ProcessUdpPacket(_, _, _))
- .WillOnce(testing::WithArg<2>(
+ .Times(packets_buffered)
+ .WillRepeatedly(testing::WithArg<2>(
Invoke(CreateFunctor(&QuicDispatcherTest::ValidatePacket,
base::Unretained(this), last_connection))));
dispatcher_->ProcessBufferedChlos(kMaxNumSessionsToCreate);
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698