OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/spdy_write_queue.h" | 5 #include "net/spdy/spdy_write_queue.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <cstring> | 8 #include <cstring> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 int i = 0; | 56 int i = 0; |
57 EXPECT_TRUE(base::StringToInt(ProducerToString(producer.Pass()), &i)); | 57 EXPECT_TRUE(base::StringToInt(ProducerToString(producer.Pass()), &i)); |
58 return i; | 58 return i; |
59 } | 59 } |
60 | 60 |
61 // Makes a SpdyStream with the given priority and a NULL SpdySession | 61 // Makes a SpdyStream with the given priority and a NULL SpdySession |
62 // -- be careful to not call any functions that expect the session to | 62 // -- be careful to not call any functions that expect the session to |
63 // be there. | 63 // be there. |
64 SpdyStream* MakeTestStream(RequestPriority priority) { | 64 SpdyStream* MakeTestStream(RequestPriority priority) { |
65 return new SpdyStream( | 65 return new SpdyStream( |
66 NULL, std::string(), priority, 0, 0, false, BoundNetLog()); | 66 SPDY_BIDIRECTIONAL_STREAM, NULL, std::string(), priority, |
| 67 0, 0, BoundNetLog()); |
67 } | 68 } |
68 | 69 |
69 // Add some frame producers of different priority. The producers | 70 // Add some frame producers of different priority. The producers |
70 // should be dequeued in priority order with their associated stream. | 71 // should be dequeued in priority order with their associated stream. |
71 TEST_F(SpdyWriteQueueTest, DequeuesByPriority) { | 72 TEST_F(SpdyWriteQueueTest, DequeuesByPriority) { |
72 SpdyWriteQueue write_queue; | 73 SpdyWriteQueue write_queue; |
73 | 74 |
74 scoped_ptr<SpdyBufferProducer> producer_low = StringToProducer("LOW"); | 75 scoped_ptr<SpdyBufferProducer> producer_low = StringToProducer("LOW"); |
75 scoped_ptr<SpdyBufferProducer> producer_medium = StringToProducer("MEDIUM"); | 76 scoped_ptr<SpdyBufferProducer> producer_medium = StringToProducer("MEDIUM"); |
76 scoped_ptr<SpdyBufferProducer> producer_highest = StringToProducer("HIGHEST"); | 77 scoped_ptr<SpdyBufferProducer> producer_highest = StringToProducer("HIGHEST"); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 242 |
242 SpdyFrameType frame_type = DATA; | 243 SpdyFrameType frame_type = DATA; |
243 scoped_ptr<SpdyBufferProducer> frame_producer; | 244 scoped_ptr<SpdyBufferProducer> frame_producer; |
244 base::WeakPtr<SpdyStream> stream; | 245 base::WeakPtr<SpdyStream> stream; |
245 EXPECT_FALSE(write_queue.Dequeue(&frame_type, &frame_producer, &stream)); | 246 EXPECT_FALSE(write_queue.Dequeue(&frame_type, &frame_producer, &stream)); |
246 } | 247 } |
247 | 248 |
248 } // namespace | 249 } // namespace |
249 | 250 |
250 } // namespace net | 251 } // namespace net |
OLD | NEW |