| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include "net/base/host_cache.h" | 7 #include "net/base/host_cache.h" |
| 8 #include "net/base/ip_endpoint.h" | 8 #include "net/base/ip_endpoint.h" |
| 9 #include "net/base/net_log_unittest.h" | 9 #include "net/base/net_log_unittest.h" |
| 10 #include "net/spdy/spdy_io_buffer.h" | 10 #include "net/spdy/spdy_io_buffer.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 virtual void OnDataSent(int length) { | 57 virtual void OnDataSent(int length) { |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual void OnClose(int status) { | 60 virtual void OnClose(int status) { |
| 61 CompletionCallback callback = callback_; | 61 CompletionCallback callback = callback_; |
| 62 callback_.Reset(); | 62 callback_.Reset(); |
| 63 callback.Run(OK); | 63 callback.Run(OK); |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual void set_chunk_callback(net::ChunkCallback *) {} | |
| 67 | |
| 68 private: | 66 private: |
| 69 CompletionCallback callback_; | 67 CompletionCallback callback_; |
| 70 }; | 68 }; |
| 71 | 69 |
| 72 // Test the SpdyIOBuffer class. | 70 // Test the SpdyIOBuffer class. |
| 73 TEST_F(SpdySessionSpdy2Test, SpdyIOBuffer) { | 71 TEST_F(SpdySessionSpdy2Test, SpdyIOBuffer) { |
| 74 std::priority_queue<SpdyIOBuffer> queue_; | 72 std::priority_queue<SpdyIOBuffer> queue_; |
| 75 const size_t kQueueSize = 100; | 73 const size_t kQueueSize = 100; |
| 76 | 74 |
| 77 // Insert items with random priority and increasing buffer size. | 75 // Insert items with random priority and increasing buffer size. |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 EXPECT_EQ(3u, spdy_stream2->stream_id()); | 1201 EXPECT_EQ(3u, spdy_stream2->stream_id()); |
| 1204 | 1202 |
| 1205 spdy_stream1->Cancel(); | 1203 spdy_stream1->Cancel(); |
| 1206 spdy_stream1 = NULL; | 1204 spdy_stream1 = NULL; |
| 1207 | 1205 |
| 1208 spdy_stream2->Cancel(); | 1206 spdy_stream2->Cancel(); |
| 1209 spdy_stream2 = NULL; | 1207 spdy_stream2 = NULL; |
| 1210 } | 1208 } |
| 1211 | 1209 |
| 1212 } // namespace net | 1210 } // namespace net |
| OLD | NEW |