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

Unified Diff: net/base/priority_queue_unittest.cc

Issue 23620058: Add a cap of six in-flight requests per host to the ResourceScheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed duplicate iteration code Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/loader/resource_scheduler_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/priority_queue_unittest.cc
diff --git a/net/base/priority_queue_unittest.cc b/net/base/priority_queue_unittest.cc
index 0baff6e005ce6c265fca489cf516dada331b86ea..daa294e12c260af6bc8f3bc659125a914603cd8e 100644
--- a/net/base/priority_queue_unittest.cc
+++ b/net/base/priority_queue_unittest.cc
@@ -89,6 +89,19 @@ TEST_F(PriorityQueueTest, FirstMaxOrder) {
CheckEmpty();
}
+TEST_F(PriorityQueueTest, FirstMaxOrderWithDeletion) {
szym 2013/11/15 19:48:52 The name suggests this is the same as FirstMaxOrde
oystein (OOO til 10th of July) 2013/11/15 19:52:20 Done.
+ PriorityQueue<int>::Pointer current = queue_.FirstMax();
+ for (size_t i = 0; i < kNumElements; ++i) {
+ EXPECT_FALSE(current.is_null());
+ EXPECT_EQ(kFirstMaxOrder[i], current.value());
+ PriorityQueue<int>::Pointer next = queue_.GetNextTowardsLastMin(current);
+ queue_.Erase(current);
+ current = next;
+ }
+ EXPECT_TRUE(current.is_null());
+ CheckEmpty();
+}
+
TEST_F(PriorityQueueTest, FirstMaxOrderErase) {
for (size_t i = 0; i < kNumElements; ++i) {
EXPECT_EQ(kFirstMaxOrder[i], queue_.FirstMax().value());
« no previous file with comments | « content/browser/loader/resource_scheduler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698