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

Side by Side Diff: net/spdy/write_blocked_list_test.cc

Issue 1472563002: Let QUIC streams write 16k before ceding. Behind FLAG_quic_batch_writes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@107581674
Patch Set: Created 5 years, 1 month 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/spdy/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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/spdy/write_blocked_list.h" 5 #include "net/spdy/write_blocked_list.h"
6 6
7 #include <deque> 7 #include <deque>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 list.PushBack(1, 4); 71 list.PushBack(1, 4);
72 list.PushBack(3, 4); 72 list.PushBack(3, 4);
73 EXPECT_EQ(3u, list.NumBlockedStreams()); 73 EXPECT_EQ(3u, list.NumBlockedStreams());
74 74
75 EXPECT_EQ(1, list.PopFront(4)); 75 EXPECT_EQ(1, list.PopFront(4));
76 EXPECT_EQ(2, list.PopFront(4)); 76 EXPECT_EQ(2, list.PopFront(4));
77 EXPECT_EQ(1u, list.NumBlockedStreams()); 77 EXPECT_EQ(1u, list.NumBlockedStreams());
78 EXPECT_EQ(3, list.PopFront(4)); 78 EXPECT_EQ(3, list.PopFront(4));
79 } 79 }
80 80
81 TEST_F(WriteBlockedListTest, PushFront) {
82 list.PushFront(1, 4);
83 EXPECT_EQ(1u, list.NumBlockedStreams());
84 list.PushFront(2, 4);
85 list.PushFront(1, 4);
86 list.PushFront(3, 4);
87 EXPECT_EQ(3u, list.NumBlockedStreams());
88
89 EXPECT_EQ(3, list.PopFront(4));
90 EXPECT_EQ(2, list.PopFront(4));
91 EXPECT_EQ(1u, list.NumBlockedStreams());
92 EXPECT_EQ(1, list.PopFront(4));
93 }
94
95 TEST_F(WriteBlockedListTest, PushFrontAndBack) {
96 list.PushFront(1, 4);
97 list.PushBack(5, 4);
98 list.PushFront(2, 4);
99 list.PushBack(3, 4);
100 list.PushFront(4, 4);
101
102 EXPECT_EQ(4, list.PopFront(4));
103 EXPECT_EQ(2, list.PopFront(4));
104 EXPECT_EQ(1, list.PopFront(4));
105 EXPECT_EQ(5, list.PopFront(4));
106 EXPECT_EQ(3, list.PopFront(4));
107 }
108
81 TEST_F(WriteBlockedListTest, UpdateStreamPriorityInWriteBlockedList) { 109 TEST_F(WriteBlockedListTest, UpdateStreamPriorityInWriteBlockedList) {
82 list.PushBack(1, 1); 110 list.PushBack(1, 1);
83 list.PushBack(2, 2); 111 list.PushBack(2, 2);
84 list.PushBack(3, 3); 112 list.PushBack(3, 3);
85 list.PushBack(1, 3); // Re-prioritizes stream 1 at priority 3. 113 list.PushBack(1, 3); // Re-prioritizes stream 1 at priority 3.
86 list.PushBack(1, 3); // No effect. 114 list.PushBack(1, 3); // No effect.
87 EXPECT_EQ(3u, list.NumBlockedStreams()); 115 EXPECT_EQ(3u, list.NumBlockedStreams());
88 EXPECT_EQ(0u, WriteBlockedListPeer::GetWriteBlockedList(1, &list)->size()); 116 EXPECT_EQ(0u, WriteBlockedListPeer::GetWriteBlockedList(1, &list)->size());
89 EXPECT_EQ(1u, WriteBlockedListPeer::GetWriteBlockedList(2, &list)->size()); 117 EXPECT_EQ(1u, WriteBlockedListPeer::GetWriteBlockedList(2, &list)->size());
90 EXPECT_EQ(2u, WriteBlockedListPeer::GetWriteBlockedList(3, &list)->size()); 118 EXPECT_EQ(2u, WriteBlockedListPeer::GetWriteBlockedList(3, &list)->size());
(...skipping 18 matching lines...) Expand all
109 EXPECT_EQ(3, list.PopFront(1)); 137 EXPECT_EQ(3, list.PopFront(1));
110 EXPECT_EQ(2, list.PopFront(2)); 138 EXPECT_EQ(2, list.PopFront(2));
111 EXPECT_EQ(1, list.PopFront(2)); 139 EXPECT_EQ(1, list.PopFront(2));
112 EXPECT_EQ(0u, list.NumBlockedStreams()); 140 EXPECT_EQ(0u, list.NumBlockedStreams());
113 } 141 }
114 142
115 } // namespace 143 } // namespace
116 144
117 } // namespace test 145 } // namespace test
118 } // namespace net 146 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/write_blocked_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698