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

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

Issue 18546008: [SPDY] Use WeakPtr<SpdySession> everywhere but SpdySessionPool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test, other minor formatting/comment changes Created 7 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_websocket_stream_unittest.cc ('k') | net/websockets/websocket_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 int i = 0; 57 int i = 0;
58 EXPECT_TRUE(base::StringToInt(ProducerToString(producer.Pass()), &i)); 58 EXPECT_TRUE(base::StringToInt(ProducerToString(producer.Pass()), &i));
59 return i; 59 return i;
60 } 60 }
61 61
62 // Makes a SpdyStream with the given priority and a NULL SpdySession 62 // Makes a SpdyStream with the given priority and a NULL SpdySession
63 // -- be careful to not call any functions that expect the session to 63 // -- be careful to not call any functions that expect the session to
64 // be there. 64 // be there.
65 SpdyStream* MakeTestStream(RequestPriority priority) { 65 SpdyStream* MakeTestStream(RequestPriority priority) {
66 return new SpdyStream( 66 return new SpdyStream(
67 SPDY_BIDIRECTIONAL_STREAM, NULL, GURL(), priority, 67 SPDY_BIDIRECTIONAL_STREAM, base::WeakPtr<SpdySession>(),
68 0, 0, BoundNetLog()); 68 GURL(), priority, 0, 0, BoundNetLog());
69 } 69 }
70 70
71 // Add some frame producers of different priority. The producers 71 // Add some frame producers of different priority. The producers
72 // should be dequeued in priority order with their associated stream. 72 // should be dequeued in priority order with their associated stream.
73 TEST_F(SpdyWriteQueueTest, DequeuesByPriority) { 73 TEST_F(SpdyWriteQueueTest, DequeuesByPriority) {
74 SpdyWriteQueue write_queue; 74 SpdyWriteQueue write_queue;
75 75
76 scoped_ptr<SpdyBufferProducer> producer_low = StringToProducer("LOW"); 76 scoped_ptr<SpdyBufferProducer> producer_low = StringToProducer("LOW");
77 scoped_ptr<SpdyBufferProducer> producer_medium = StringToProducer("MEDIUM"); 77 scoped_ptr<SpdyBufferProducer> producer_medium = StringToProducer("MEDIUM");
78 scoped_ptr<SpdyBufferProducer> producer_highest = StringToProducer("HIGHEST"); 78 scoped_ptr<SpdyBufferProducer> producer_highest = StringToProducer("HIGHEST");
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 SpdyFrameType frame_type = DATA; 244 SpdyFrameType frame_type = DATA;
245 scoped_ptr<SpdyBufferProducer> frame_producer; 245 scoped_ptr<SpdyBufferProducer> frame_producer;
246 base::WeakPtr<SpdyStream> stream; 246 base::WeakPtr<SpdyStream> stream;
247 EXPECT_FALSE(write_queue.Dequeue(&frame_type, &frame_producer, &stream)); 247 EXPECT_FALSE(write_queue.Dequeue(&frame_type, &frame_producer, &stream));
248 } 248 }
249 249
250 } // namespace 250 } // namespace
251 251
252 } // namespace net 252 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_websocket_stream_unittest.cc ('k') | net/websockets/websocket_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698