Index: net/spdy/spdy_session_spdy2_unittest.cc |
diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc |
index 8afbed297141ee91a5da3c871d276c8d8103f589..6da62ab1bf5c3a462e4cd7a0498aef441cc6a6d0 100644 |
--- a/net/spdy/spdy_session_spdy2_unittest.cc |
+++ b/net/spdy/spdy_session_spdy2_unittest.cc |
@@ -74,34 +74,35 @@ TEST_F(SpdySessionSpdy2Test, SpdyIOBuffer) { |
std::priority_queue<SpdyIOBuffer> queue_; |
const size_t kQueueSize = 100; |
- // Insert 100 items; pri 100 to 1. |
+ // Insert 100 items; pri 0 to 99. |
for (size_t index = 0; index < kQueueSize; ++index) { |
- SpdyIOBuffer buffer(new IOBuffer(), 0, kQueueSize - index, NULL); |
+ SpdyIOBuffer buffer(new IOBuffer(), 0, index, NULL); |
queue_.push(buffer); |
} |
- // Insert several priority 0 items last. |
+ // Insert several priority 100 items last. |
const size_t kNumDuplicates = 12; |
IOBufferWithSize* buffers[kNumDuplicates]; |
for (size_t index = 0; index < kNumDuplicates; ++index) { |
buffers[index] = new IOBufferWithSize(index+1); |
- queue_.push(SpdyIOBuffer(buffers[index], buffers[index]->size(), 0, NULL)); |
+ queue_.push(SpdyIOBuffer(buffers[index], buffers[index]->size(), 100, |
+ NULL)); |
} |
EXPECT_EQ(kQueueSize + kNumDuplicates, queue_.size()); |
- // Verify the P0 items come out in FIFO order. |
+ // Verify the P100 items come out in FIFO order. |
for (size_t index = 0; index < kNumDuplicates; ++index) { |
SpdyIOBuffer buffer = queue_.top(); |
- EXPECT_EQ(0, buffer.priority()); |
+ EXPECT_EQ(100, buffer.priority()); |
EXPECT_EQ(index + 1, buffer.size()); |
queue_.pop(); |
} |
- int priority = 1; |
+ int priority = 99; |
while (queue_.size()) { |
SpdyIOBuffer buffer = queue_.top(); |
- EXPECT_EQ(priority++, buffer.priority()); |
+ EXPECT_EQ(priority--, buffer.priority()); |
queue_.pop(); |
} |
} |