| 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..7ac1fef0bfad428d66bc5a7defd7b9373b7d0051 100644
|
| --- a/net/base/priority_queue_unittest.cc
|
| +++ b/net/base/priority_queue_unittest.cc
|
| @@ -105,6 +105,29 @@ TEST_F(PriorityQueueTest, LastMaxOrderErase) {
|
| CheckEmpty();
|
| }
|
|
|
| +TEST_F(PriorityQueueTest, NextHighestIteration) {
|
| + 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());
|
| + current = queue_.NextHighest(current);
|
| + }
|
| + EXPECT_TRUE(current.is_null());
|
| +}
|
| +
|
| +TEST_F(PriorityQueueTest, NextHighestIterationWithDeletion) {
|
| + 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_.NextHighest(current);
|
| + queue_.Erase(current);
|
| + current = next;
|
| + }
|
| + EXPECT_TRUE(current.is_null());
|
| + CheckEmpty();
|
| +}
|
| +
|
| TEST_F(PriorityQueueTest, EraseFromMiddle) {
|
| queue_.Erase(pointers_[2]);
|
| queue_.Erase(pointers_[3]);
|
|
|