| 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 <stack> | 5 #include <stack> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 void TestRequest(const std::string& method, | 241 void TestRequest(const std::string& method, |
| 242 const net::HttpRequestHeaders& extra_headers, | 242 const net::HttpRequestHeaders& extra_headers, |
| 243 BlobData* blob_data) { | 243 BlobData* blob_data) { |
| 244 // This test has async steps. | 244 // This test has async steps. |
| 245 request_.reset(new net::URLRequest(GURL("blob:blah"), | 245 request_.reset(new net::URLRequest(GURL("blob:blah"), |
| 246 url_request_delegate_.get(), | 246 url_request_delegate_.get(), |
| 247 &empty_context_)); | 247 &empty_context_)); |
| 248 request_->set_method(method); | 248 request_->set_method(method); |
| 249 blob_url_request_job_ = new BlobURLRequestJob( | 249 blob_url_request_job_ = new BlobURLRequestJob( |
| 250 request_.get(), | 250 request_.get(), |
| 251 request_->context()->network_delegate(), |
| 251 blob_data, | 252 blob_data, |
| 252 base::MessageLoopProxy::current()); | 253 base::MessageLoopProxy::current()); |
| 253 | 254 |
| 254 // Start the request. | 255 // Start the request. |
| 255 if (!extra_headers.IsEmpty()) | 256 if (!extra_headers.IsEmpty()) |
| 256 request_->SetExtraRequestHeaders(extra_headers); | 257 request_->SetExtraRequestHeaders(extra_headers); |
| 257 request_->Start(); | 258 request_->Start(); |
| 258 | 259 |
| 259 // Completion is async. | 260 // Completion is async. |
| 260 } | 261 } |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 445 |
| 445 TEST_F(BlobURLRequestJobTest, TestGetRangeRequest2) { | 446 TEST_F(BlobURLRequestJobTest, TestGetRangeRequest2) { |
| 446 RunTestOnIOThread(&BlobURLRequestJobTest::TestGetRangeRequest2); | 447 RunTestOnIOThread(&BlobURLRequestJobTest::TestGetRangeRequest2); |
| 447 } | 448 } |
| 448 | 449 |
| 449 TEST_F(BlobURLRequestJobTest, TestExtraHeaders) { | 450 TEST_F(BlobURLRequestJobTest, TestExtraHeaders) { |
| 450 RunTestOnIOThread(&BlobURLRequestJobTest::TestExtraHeaders); | 451 RunTestOnIOThread(&BlobURLRequestJobTest::TestExtraHeaders); |
| 451 } | 452 } |
| 452 | 453 |
| 453 } // namespace webkit_blob | 454 } // namespace webkit_blob |
| OLD | NEW |