| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_io_buffer.h" | 5 #include "net/spdy/spdy_io_buffer.h" |
| 6 | 6 |
| 7 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
| 8 #include "net/base/mock_host_resolver.h" | 8 #include "net/base/mock_host_resolver.h" |
| 9 #include "net/base/ssl_config_service_defaults.h" | 9 #include "net/base/ssl_config_service_defaults.h" |
| 10 #include "net/base/test_completion_callback.h" | 10 #include "net/base/test_completion_callback.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 MockClientSocketFactory socket_factory; | 47 MockClientSocketFactory socket_factory; |
| 48 scoped_refptr<SpdySessionPool> spdy_session_pool; | 48 scoped_refptr<SpdySessionPool> spdy_session_pool; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { | 51 HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { |
| 52 return new HttpNetworkSession(NULL, | 52 return new HttpNetworkSession(NULL, |
| 53 session_deps->host_resolver, | 53 session_deps->host_resolver, |
| 54 session_deps->proxy_service, | 54 session_deps->proxy_service, |
| 55 &session_deps->socket_factory, | 55 &session_deps->socket_factory, |
| 56 session_deps->ssl_config_service, | 56 session_deps->ssl_config_service, |
| 57 session_deps->spdy_session_pool, |
| 57 NULL); | 58 NULL); |
| 58 } | 59 } |
| 59 | 60 |
| 60 // Test the SpdyIOBuffer class. | 61 // Test the SpdyIOBuffer class. |
| 61 TEST_F(SpdySessionTest, SpdyIOBuffer) { | 62 TEST_F(SpdySessionTest, SpdyIOBuffer) { |
| 62 std::priority_queue<SpdyIOBuffer> queue_; | 63 std::priority_queue<SpdyIOBuffer> queue_; |
| 63 const size_t kQueueSize = 100; | 64 const size_t kQueueSize = 100; |
| 64 | 65 |
| 65 // Insert 100 items; pri 100 to 1. | 66 // Insert 100 items; pri 100 to 1. |
| 66 for (size_t index = 0; index < kQueueSize; ++index) { | 67 for (size_t index = 0; index < kQueueSize; ++index) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 session = NULL; | 239 session = NULL; |
| 239 spdy_session_pool->CloseAllSessions(); | 240 spdy_session_pool->CloseAllSessions(); |
| 240 | 241 |
| 241 // RunAllPending needs to be called here because the | 242 // RunAllPending needs to be called here because the |
| 242 // ClientSocketPoolBase posts a task to clean up and destroy the | 243 // ClientSocketPoolBase posts a task to clean up and destroy the |
| 243 // underlying socket. | 244 // underlying socket. |
| 244 MessageLoop::current()->RunAllPending(); | 245 MessageLoop::current()->RunAllPending(); |
| 245 } | 246 } |
| 246 | 247 |
| 247 } // namespace net | 248 } // namespace net |
| OLD | NEW |