| 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_host_forced.h" | 5 #include "net/http/http_pipelined_host_forced.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "net/http/http_pipelined_host_test_util.h" | 8 #include "net/http/http_pipelined_host_test_util.h" |
| 9 #include "net/proxy/proxy_info.h" | 9 #include "net/proxy/proxy_info.h" |
| 10 #include "net/socket/client_socket_handle.h" | 10 #include "net/socket/client_socket_handle.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 factory_(new MockPipelineFactory), // Owned by |host_|. | 30 factory_(new MockPipelineFactory), // Owned by |host_|. |
| 31 host_(new HttpPipelinedHostForced(&delegate_, key_, factory_)) { | 31 host_(new HttpPipelinedHostForced(&delegate_, key_, factory_)) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 MockPipeline* AddTestPipeline() { | 34 MockPipeline* AddTestPipeline() { |
| 35 MockPipeline* pipeline = new MockPipeline(0, true, true); | 35 MockPipeline* pipeline = new MockPipeline(0, true, true); |
| 36 EXPECT_CALL(*factory_, CreateNewPipeline(&connection_, host_.get(), | 36 EXPECT_CALL(*factory_, CreateNewPipeline(&connection_, host_.get(), |
| 37 MatchesOrigin(key_.origin()), | 37 MatchesOrigin(key_.origin()), |
| 38 Ref(ssl_config_), Ref(proxy_info_), | 38 Ref(ssl_config_), Ref(proxy_info_), |
| 39 Ref(net_log_), true, | 39 Ref(net_log_), true, |
| 40 kProtoSPDY2)) | 40 kProtoSPDY3)) |
| 41 .Times(1) | 41 .Times(1) |
| 42 .WillOnce(Return(pipeline)); | 42 .WillOnce(Return(pipeline)); |
| 43 EXPECT_CALL(*pipeline, CreateNewStream()) | 43 EXPECT_CALL(*pipeline, CreateNewStream()) |
| 44 .Times(1) | 44 .Times(1) |
| 45 .WillOnce(Return(kDummyStream)); | 45 .WillOnce(Return(kDummyStream)); |
| 46 EXPECT_EQ(kDummyStream, host_->CreateStreamOnNewPipeline( | 46 EXPECT_EQ(kDummyStream, host_->CreateStreamOnNewPipeline( |
| 47 &connection_, ssl_config_, proxy_info_, net_log_, true, | 47 &connection_, ssl_config_, proxy_info_, net_log_, true, |
| 48 kProtoSPDY2)); | 48 kProtoSPDY3)); |
| 49 return pipeline; | 49 return pipeline; |
| 50 } | 50 } |
| 51 | 51 |
| 52 ClientSocketHandle connection_; | 52 ClientSocketHandle connection_; |
| 53 NiceMock<MockHostDelegate> delegate_; | 53 NiceMock<MockHostDelegate> delegate_; |
| 54 HttpPipelinedHost::Key key_; | 54 HttpPipelinedHost::Key key_; |
| 55 MockPipelineFactory* factory_; | 55 MockPipelineFactory* factory_; |
| 56 scoped_ptr<HttpPipelinedHostForced> host_; | 56 scoped_ptr<HttpPipelinedHostForced> host_; |
| 57 | 57 |
| 58 SSLConfig ssl_config_; | 58 SSLConfig ssl_config_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 EXPECT_CALL(delegate_, OnHostHasAdditionalCapacity(host_.get())) | 97 EXPECT_CALL(delegate_, OnHostHasAdditionalCapacity(host_.get())) |
| 98 .Times(1); | 98 .Times(1); |
| 99 EXPECT_CALL(delegate_, OnHostIdle(host_.get())) | 99 EXPECT_CALL(delegate_, OnHostIdle(host_.get())) |
| 100 .Times(1); | 100 .Times(1); |
| 101 host_->OnPipelineHasCapacity(pipeline); | 101 host_->OnPipelineHasCapacity(pipeline); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // anonymous namespace | 104 } // anonymous namespace |
| 105 | 105 |
| 106 } // namespace net | 106 } // namespace net |
| OLD | NEW |