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 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) | 5 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) |
6 // rather than as part of test_shell_tests because they rely on being able | 6 // rather than as part of test_shell_tests because they rely on being able |
7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses | 7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses |
8 // TYPE_UI, which URLRequest doesn't allow. | 8 // TYPE_UI, which URLRequest doesn't allow. |
9 // | 9 // |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/string_piece.h" | 22 #include "base/string_piece.h" |
23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
24 #include "net/base/net_errors.h" | 24 #include "net/base/net_errors.h" |
25 #include "net/base/net_util.h" | 25 #include "net/base/net_util.h" |
26 #include "net/http/http_request_headers.h" | 26 #include "net/http/http_request_headers.h" |
27 #include "net/url_request/url_request.h" | 27 #include "net/url_request/url_request.h" |
28 #include "net/url_request/url_request_test_util.h" | 28 #include "net/url_request/url_request_test_util.h" |
29 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
30 #include "unicode/regex.h" | 30 #include "unicode/regex.h" |
31 #include "webkit/fileapi/file_system_context.h" | 31 #include "webkit/fileapi/file_system_context.h" |
32 #include "webkit/fileapi/file_system_file_util.h" | |
33 #include "webkit/fileapi/file_system_operation_context.h" | 32 #include "webkit/fileapi/file_system_operation_context.h" |
34 #include "webkit/fileapi/file_system_path_manager.h" | 33 #include "webkit/fileapi/file_system_path_manager.h" |
| 34 #include "webkit/fileapi/fileapi_file_util.h" |
35 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 35 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
36 | 36 |
37 namespace fileapi { | 37 namespace fileapi { |
38 namespace { | 38 namespace { |
39 | 39 |
40 // We always use the TEMPORARY FileSystem in this test. | 40 // We always use the TEMPORARY FileSystem in this test. |
41 static const char kFileSystemURLPrefix[] = | 41 static const char kFileSystemURLPrefix[] = |
42 "filesystem:http://remote/temporary/"; | 42 "filesystem:http://remote/temporary/"; |
43 | 43 |
44 class TestSpecialStoragePolicy : public quota::SpecialStoragePolicy { | 44 class TestSpecialStoragePolicy : public quota::SpecialStoragePolicy { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 static net::URLRequestJob* FileSystemDirURLRequestJobFactory( | 209 static net::URLRequestJob* FileSystemDirURLRequestJobFactory( |
210 net::URLRequest* request, | 210 net::URLRequest* request, |
211 const std::string& scheme) { | 211 const std::string& scheme) { |
212 DCHECK(job_); | 212 DCHECK(job_); |
213 net::URLRequestJob* temp = job_; | 213 net::URLRequestJob* temp = job_; |
214 job_ = NULL; | 214 job_ = NULL; |
215 return temp; | 215 return temp; |
216 } | 216 } |
217 | 217 |
218 FileSystemFileUtil* file_util() { | 218 FileUtil* file_util() { |
219 return file_system_context_->path_manager()->sandbox_provider()-> | 219 return file_system_context_->path_manager()->sandbox_provider()-> |
220 GetFileSystemFileUtil(); | 220 GetFileUtil(); |
221 } | 221 } |
222 | 222 |
223 // Put the message loop at the top, so that it's the last thing deleted. | 223 // Put the message loop at the top, so that it's the last thing deleted. |
224 MessageLoop message_loop_; | 224 MessageLoop message_loop_; |
225 // Delete all MessageLoopProxy objects before the MessageLoop, to help prevent | 225 // Delete all MessageLoopProxy objects before the MessageLoop, to help prevent |
226 // leaks caused by tasks posted during shutdown. | 226 // leaks caused by tasks posted during shutdown. |
227 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; | 227 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; |
228 | 228 |
229 ScopedTempDir temp_dir_; | 229 ScopedTempDir temp_dir_; |
230 FilePath root_path_; | 230 FilePath root_path_; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 MessageLoop::current()->PostTask(FROM_HERE, new QuitNowTask); | 310 MessageLoop::current()->PostTask(FROM_HERE, new QuitNowTask); |
311 MessageLoop::current()->Run(); | 311 MessageLoop::current()->Run(); |
312 | 312 |
313 request_.reset(); | 313 request_.reset(); |
314 MessageLoop::current()->RunAllPending(); | 314 MessageLoop::current()->RunAllPending(); |
315 // If we get here, success! we didn't crash! | 315 // If we get here, success! we didn't crash! |
316 } | 316 } |
317 | 317 |
318 } // namespace (anonymous) | 318 } // namespace (anonymous) |
319 } // namespace fileapi | 319 } // namespace fileapi |
OLD | NEW |