| 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" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 void TearDown() { | 76 void TearDown() { |
| 77 MessageLoop::current()->RunAllPending(); | 77 MessageLoop::current()->RunAllPending(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void Initialize(MockRead* reads, size_t reads_count, | 80 void Initialize(MockRead* reads, size_t reads_count, |
| 81 MockWrite* writes, size_t writes_count) { | 81 MockWrite* writes, size_t writes_count) { |
| 82 data_ = new DeterministicSocketData(reads, reads_count, | 82 data_ = new DeterministicSocketData(reads, reads_count, |
| 83 writes, writes_count); | 83 writes, writes_count); |
| 84 data_->set_connect_data(MockConnect(false, 0)); | 84 data_->set_connect_data(MockConnect(SYNCHRONOUS, OK)); |
| 85 if (reads_count || writes_count) { | 85 if (reads_count || writes_count) { |
| 86 data_->StopAfter(reads_count + writes_count); | 86 data_->StopAfter(reads_count + writes_count); |
| 87 } | 87 } |
| 88 factory_.AddSocketDataProvider(data_.get()); | 88 factory_.AddSocketDataProvider(data_.get()); |
| 89 scoped_refptr<DummySocketParams> params; | 89 scoped_refptr<DummySocketParams> params; |
| 90 ClientSocketHandle* connection = new ClientSocketHandle; | 90 ClientSocketHandle* connection = new ClientSocketHandle; |
| 91 connection->Init("a", params, MEDIUM, CompletionCallback(), &pool_, | 91 connection->Init("a", params, MEDIUM, CompletionCallback(), &pool_, |
| 92 BoundNetLog()); | 92 BoundNetLog()); |
| 93 pipeline_.reset(new HttpPipelinedConnectionImpl( | 93 pipeline_.reset(new HttpPipelinedConnectionImpl( |
| 94 connection, &delegate_, origin_, ssl_config_, proxy_info_, | 94 connection, &delegate_, origin_, ssl_config_, proxy_info_, |
| (...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1504 MessageLoop::current()->RunAllPending(); | 1504 MessageLoop::current()->RunAllPending(); |
| 1505 | 1505 |
| 1506 stream->Close(false); | 1506 stream->Close(false); |
| 1507 EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1); | 1507 EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1); |
| 1508 stream.reset(NULL); | 1508 stream.reset(NULL); |
| 1509 } | 1509 } |
| 1510 | 1510 |
| 1511 } // anonymous namespace | 1511 } // anonymous namespace |
| 1512 | 1512 |
| 1513 } // namespace net | 1513 } // namespace net |
| OLD | NEW |