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/http/http_pipelined_connection_impl.h" | 5 #include "net/http/http_pipelined_connection_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
13 #include "net/base/request_priority.h" | 13 #include "net/base/request_priority.h" |
14 #include "net/http/http_pipelined_stream.h" | 14 #include "net/http/http_pipelined_stream.h" |
15 #include "net/socket/client_socket_handle.h" | 15 #include "net/socket/client_socket_handle.h" |
16 #include "net/socket/client_socket_pool_histograms.h" | 16 #include "net/socket/client_socket_pool_histograms.h" |
17 #include "net/socket/socket_test_util.h" | 17 #include "net/socket/socket_test_util.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 using testing::_; | 21 using testing::_; |
22 using testing::NiceMock; | 22 using testing::NiceMock; |
23 using testing::StrEq; | 23 using testing::StrEq; |
24 | 24 |
25 namespace net { | 25 namespace net { |
26 | 26 |
27 class DummySocketParams : public base::RefCounted<DummySocketParams> { | 27 class DummySocketParams : public base::RefCounted<DummySocketParams> { |
28 private: | 28 private: |
29 friend class base::RefCounted<DummySocketParams>; | 29 friend class base::RefCounted<DummySocketParams>; |
| 30 ~DummySocketParams() {} |
30 }; | 31 }; |
31 | 32 |
32 REGISTER_SOCKET_PARAMS_FOR_POOL(MockTransportClientSocketPool, | 33 REGISTER_SOCKET_PARAMS_FOR_POOL(MockTransportClientSocketPool, |
33 DummySocketParams); | 34 DummySocketParams); |
34 | 35 |
35 namespace { | 36 namespace { |
36 | 37 |
37 class MockPipelineDelegate : public HttpPipelinedConnection::Delegate { | 38 class MockPipelineDelegate : public HttpPipelinedConnection::Delegate { |
38 public: | 39 public: |
39 MOCK_METHOD1(OnPipelineHasCapacity, void(HttpPipelinedConnection* pipeline)); | 40 MOCK_METHOD1(OnPipelineHasCapacity, void(HttpPipelinedConnection* pipeline)); |
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 MessageLoop::current()->RunAllPending(); | 1533 MessageLoop::current()->RunAllPending(); |
1533 | 1534 |
1534 stream->Close(false); | 1535 stream->Close(false); |
1535 EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1); | 1536 EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1); |
1536 stream.reset(NULL); | 1537 stream.reset(NULL); |
1537 } | 1538 } |
1538 | 1539 |
1539 } // anonymous namespace | 1540 } // anonymous namespace |
1540 | 1541 |
1541 } // namespace net | 1542 } // namespace net |
OLD | NEW |