OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 MockWrite* writes, size_t writes_count) { | 79 MockWrite* writes, size_t writes_count) { |
80 data_ = new DeterministicSocketData(reads, reads_count, | 80 data_ = new DeterministicSocketData(reads, reads_count, |
81 writes, writes_count); | 81 writes, writes_count); |
82 data_->set_connect_data(MockConnect(false, 0)); | 82 data_->set_connect_data(MockConnect(false, 0)); |
83 if (reads_count || writes_count) { | 83 if (reads_count || writes_count) { |
84 data_->StopAfter(reads_count + writes_count); | 84 data_->StopAfter(reads_count + writes_count); |
85 } | 85 } |
86 factory_.AddSocketDataProvider(data_.get()); | 86 factory_.AddSocketDataProvider(data_.get()); |
87 scoped_refptr<DummySocketParams> params; | 87 scoped_refptr<DummySocketParams> params; |
88 ClientSocketHandle* connection = new ClientSocketHandle; | 88 ClientSocketHandle* connection = new ClientSocketHandle; |
89 connection->Init("a", params, MEDIUM, NULL, &pool_, BoundNetLog()); | 89 connection->Init("a", params, MEDIUM, CompletionCallback(), &pool_, |
| 90 BoundNetLog()); |
90 pipeline_.reset(new HttpPipelinedConnectionImpl(connection, &delegate_, | 91 pipeline_.reset(new HttpPipelinedConnectionImpl(connection, &delegate_, |
91 ssl_config_, proxy_info_, | 92 ssl_config_, proxy_info_, |
92 BoundNetLog(), false)); | 93 BoundNetLog(), false)); |
93 } | 94 } |
94 | 95 |
95 HttpRequestInfo* GetRequestInfo(const std::string& filename) { | 96 HttpRequestInfo* GetRequestInfo(const std::string& filename) { |
96 HttpRequestInfo* request_info = new HttpRequestInfo; | 97 HttpRequestInfo* request_info = new HttpRequestInfo; |
97 request_info->url = GURL("http://localhost/" + filename); | 98 request_info->url = GURL("http://localhost/" + filename); |
98 request_info->method = "GET"; | 99 request_info->method = "GET"; |
99 request_info_vector_.push_back(request_info); | 100 request_info_vector_.push_back(request_info); |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 MessageLoop::current()->RunAllPending(); | 1383 MessageLoop::current()->RunAllPending(); |
1383 | 1384 |
1384 stream->Close(false); | 1385 stream->Close(false); |
1385 EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1); | 1386 EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1); |
1386 stream.reset(NULL); | 1387 stream.reset(NULL); |
1387 } | 1388 } |
1388 | 1389 |
1389 } // anonymous namespace | 1390 } // anonymous namespace |
1390 | 1391 |
1391 } // namespace net | 1392 } // namespace net |
OLD | NEW |