| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "webkit/browser/fileapi/file_system_dir_url_request_job.h" | 5 #include "webkit/browser/fileapi/file_system_dir_url_request_job.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 const std::string& name, | 81 const std::string& name, |
| 82 base::File::Error result) { | 82 base::File::Error result) { |
| 83 ASSERT_EQ(base::File::FILE_OK, result); | 83 ASSERT_EQ(base::File::FILE_OK, result); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void TestRequestHelper(const GURL& url, bool run_to_completion, | 86 void TestRequestHelper(const GURL& url, bool run_to_completion, |
| 87 FileSystemContext* file_system_context) { | 87 FileSystemContext* file_system_context) { |
| 88 delegate_.reset(new net::TestDelegate()); | 88 delegate_.reset(new net::TestDelegate()); |
| 89 delegate_->set_quit_on_redirect(true); | 89 delegate_->set_quit_on_redirect(true); |
| 90 request_ = empty_context_.CreateRequest( | 90 request_ = empty_context_.CreateRequest( |
| 91 url, net::DEFAULT_PRIORITY, delegate_.get()); | 91 url, net::DEFAULT_PRIORITY, delegate_.get(), NULL); |
| 92 job_ = new fileapi::FileSystemDirURLRequestJob( | 92 job_ = new fileapi::FileSystemDirURLRequestJob( |
| 93 request_.get(), NULL, file_system_context); | 93 request_.get(), NULL, file_system_context); |
| 94 | 94 |
| 95 request_->Start(); | 95 request_->Start(); |
| 96 ASSERT_TRUE(request_->is_pending()); // verify that we're starting async | 96 ASSERT_TRUE(request_->is_pending()); // verify that we're starting async |
| 97 if (run_to_completion) | 97 if (run_to_completion) |
| 98 base::MessageLoop::current()->Run(); | 98 base::MessageLoop::current()->Run(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void TestRequest(const GURL& url) { | 101 void TestRequest(const GURL& url) { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 316 |
| 317 TestRequestWithContext(CreateFileSystemURL("foo"), | 317 TestRequestWithContext(CreateFileSystemURL("foo"), |
| 318 file_system_context.get()); | 318 file_system_context.get()); |
| 319 ASSERT_FALSE(request_->is_pending()); | 319 ASSERT_FALSE(request_->is_pending()); |
| 320 ASSERT_FALSE(request_->status().is_success()); | 320 ASSERT_FALSE(request_->status().is_success()); |
| 321 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); | 321 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace (anonymous) | 324 } // namespace (anonymous) |
| 325 } // namespace content | 325 } // namespace content |
| OLD | NEW |