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

Side by Side Diff: net/quic/quic_write_blocked_list_test.cc

Issue 1780913002: Deprecating FLAG_quic_batch_writes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@115853846
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_write_blocked_list.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_write_blocked_list.h" 5 #include "net/quic/quic_write_blocked_list.h"
6 6
7 #include "net/quic/test_tools/quic_test_utils.h" 7 #include "net/quic/test_tools/quic_test_utils.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 using net::kV3LowestPriority; 10 using net::kV3LowestPriority;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 EXPECT_EQ(1u, write_blocked_list.NumBlockedStreams()); 108 EXPECT_EQ(1u, write_blocked_list.NumBlockedStreams());
109 EXPECT_TRUE(write_blocked_list.HasWriteBlockedDataStreams()); 109 EXPECT_TRUE(write_blocked_list.HasWriteBlockedDataStreams());
110 110
111 // There should only be one stream to pop off the front. 111 // There should only be one stream to pop off the front.
112 EXPECT_EQ(kBlockedId, write_blocked_list.PopFront()); 112 EXPECT_EQ(kBlockedId, write_blocked_list.PopFront());
113 EXPECT_EQ(0u, write_blocked_list.NumBlockedStreams()); 113 EXPECT_EQ(0u, write_blocked_list.NumBlockedStreams());
114 EXPECT_FALSE(write_blocked_list.HasWriteBlockedDataStreams()); 114 EXPECT_FALSE(write_blocked_list.HasWriteBlockedDataStreams());
115 } 115 }
116 116
117 TEST(QuicWriteBlockedListTest, BatchingWrites) { 117 TEST(QuicWriteBlockedListTest, BatchingWrites) {
118 ValueRestore<bool> old_flag(&FLAGS_quic_batch_writes, true);
119 QuicWriteBlockedList write_blocked_list; 118 QuicWriteBlockedList write_blocked_list;
120 119
121 const QuicStreamId id1 = kClientDataStreamId1; 120 const QuicStreamId id1 = kClientDataStreamId1;
122 const QuicStreamId id2 = kClientDataStreamId2; 121 const QuicStreamId id2 = kClientDataStreamId2;
123 const QuicStreamId id3 = kClientDataStreamId2 + 2; 122 const QuicStreamId id3 = kClientDataStreamId2 + 2;
124 write_blocked_list.RegisterStream(id1, kV3LowestPriority); 123 write_blocked_list.RegisterStream(id1, kV3LowestPriority);
125 write_blocked_list.RegisterStream(id2, kV3LowestPriority); 124 write_blocked_list.RegisterStream(id2, kV3LowestPriority);
126 write_blocked_list.RegisterStream(id3, kV3HighestPriority); 125 write_blocked_list.RegisterStream(id3, kV3HighestPriority);
127 126
128 write_blocked_list.AddStream(id1); 127 write_blocked_list.AddStream(id1);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 write_blocked_list.AddStream(kCryptoStreamId); 210 write_blocked_list.AddStream(kCryptoStreamId);
212 EXPECT_TRUE(write_blocked_list.ShouldYield(16)); 211 EXPECT_TRUE(write_blocked_list.ShouldYield(16));
213 EXPECT_TRUE(write_blocked_list.ShouldYield(15)); 212 EXPECT_TRUE(write_blocked_list.ShouldYield(15));
214 EXPECT_TRUE(write_blocked_list.ShouldYield(kHeadersStreamId)); 213 EXPECT_TRUE(write_blocked_list.ShouldYield(kHeadersStreamId));
215 EXPECT_FALSE(write_blocked_list.ShouldYield(kCryptoStreamId)); 214 EXPECT_FALSE(write_blocked_list.ShouldYield(kCryptoStreamId));
216 } 215 }
217 216
218 } // namespace 217 } // namespace
219 } // namespace test 218 } // namespace test
220 } // namespace net 219 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_write_blocked_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698