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 <stack> | 5 #include <stack> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 void TestRequest(const std::string& method, | 247 void TestRequest(const std::string& method, |
248 const net::HttpRequestHeaders& extra_headers, | 248 const net::HttpRequestHeaders& extra_headers, |
249 BlobData* blob_data) { | 249 BlobData* blob_data) { |
250 // This test has async steps. | 250 // This test has async steps. |
251 request_.reset(new net::URLRequest(GURL("blob:blah"), | 251 request_.reset(new net::URLRequest(GURL("blob:blah"), |
252 url_request_delegate_.get())); | 252 url_request_delegate_.get())); |
253 request_->set_method(method); | 253 request_->set_method(method); |
254 blob_url_request_job_ = new BlobURLRequestJob( | 254 blob_url_request_job_ = new BlobURLRequestJob( |
255 request_.get(), | 255 request_.get(), |
256 blob_data, | 256 blob_data, |
257 base::MessageLoopProxy::CreateForCurrentThread()); | 257 base::MessageLoopProxy::current()); |
258 | 258 |
259 // Start the request. | 259 // Start the request. |
260 if (!extra_headers.IsEmpty()) | 260 if (!extra_headers.IsEmpty()) |
261 request_->SetExtraRequestHeaders(extra_headers); | 261 request_->SetExtraRequestHeaders(extra_headers); |
262 request_->Start(); | 262 request_->Start(); |
263 | 263 |
264 // Completion is async. | 264 // Completion is async. |
265 } | 265 } |
266 | 266 |
267 void VerifyResponse() { | 267 void VerifyResponse() { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 462 |
463 TEST_F(BlobURLRequestJobTest, TestExtraHeaders) { | 463 TEST_F(BlobURLRequestJobTest, TestExtraHeaders) { |
464 RunTestOnIOThread(&BlobURLRequestJobTest::TestExtraHeaders); | 464 RunTestOnIOThread(&BlobURLRequestJobTest::TestExtraHeaders); |
465 } | 465 } |
466 | 466 |
467 } // namespace webkit_blob | 467 } // namespace webkit_blob |
468 | 468 |
469 // BlobURLRequestJobTest is expected to always live longer than the | 469 // BlobURLRequestJobTest is expected to always live longer than the |
470 // runnable methods. This lets us call NewRunnableMethod on its instances. | 470 // runnable methods. This lets us call NewRunnableMethod on its instances. |
471 DISABLE_RUNNABLE_METHOD_REFCOUNT(webkit_blob::BlobURLRequestJobTest); | 471 DISABLE_RUNNABLE_METHOD_REFCOUNT(webkit_blob::BlobURLRequestJobTest); |
OLD | NEW |