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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/message_loop_proxy.h" | 13 #include "base/message_loop_proxy.h" |
14 #include "base/scoped_temp_dir.h" | 14 #include "base/scoped_temp_dir.h" |
15 #include "base/time.h" | 15 #include "base/time.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "webkit/fileapi/file_system_context.h" | 17 #include "webkit/fileapi/file_system_context.h" |
18 #include "webkit/fileapi/file_system_operation_context.h" | 18 #include "webkit/fileapi/file_system_operation_context.h" |
| 19 #include "webkit/fileapi/file_system_task_runners.h" |
19 #include "webkit/fileapi/file_util_helper.h" | 20 #include "webkit/fileapi/file_util_helper.h" |
20 #include "webkit/fileapi/isolated_context.h" | 21 #include "webkit/fileapi/isolated_context.h" |
21 #include "webkit/fileapi/isolated_file_util.h" | 22 #include "webkit/fileapi/isolated_file_util.h" |
22 #include "webkit/fileapi/local_file_system_test_helper.h" | 23 #include "webkit/fileapi/local_file_system_test_helper.h" |
23 #include "webkit/fileapi/local_file_util.h" | 24 #include "webkit/fileapi/local_file_util.h" |
24 #include "webkit/fileapi/mock_file_system_options.h" | 25 #include "webkit/fileapi/mock_file_system_options.h" |
25 #include "webkit/fileapi/native_file_util.h" | 26 #include "webkit/fileapi/native_file_util.h" |
26 #include "webkit/fileapi/test_file_set.h" | 27 #include "webkit/fileapi/test_file_set.h" |
27 #include "webkit/quota/mock_special_storage_policy.h" | 28 #include "webkit/quota/mock_special_storage_policy.h" |
28 | 29 |
(...skipping 29 matching lines...) Expand all Loading... |
58 | 59 |
59 void SetUp() { | 60 void SetUp() { |
60 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 61 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
61 file_util_.reset(new DraggedFileUtil()); | 62 file_util_.reset(new DraggedFileUtil()); |
62 | 63 |
63 // Register the files/directories of RegularTestCases (with random | 64 // Register the files/directories of RegularTestCases (with random |
64 // root paths) as dropped files. | 65 // root paths) as dropped files. |
65 SimulateDropFiles(); | 66 SimulateDropFiles(); |
66 | 67 |
67 file_system_context_ = new FileSystemContext( | 68 file_system_context_ = new FileSystemContext( |
68 base::MessageLoopProxy::current(), | 69 FileSystemTaskRunners::CreateMockTaskRunners(), |
69 base::MessageLoopProxy::current(), | |
70 make_scoped_refptr(new quota::MockSpecialStoragePolicy()), | 70 make_scoped_refptr(new quota::MockSpecialStoragePolicy()), |
71 NULL /* quota_manager */, | 71 NULL /* quota_manager */, |
72 data_dir_.path(), | 72 data_dir_.path(), |
73 CreateAllowFileAccessOptions()); | 73 CreateAllowFileAccessOptions()); |
74 | 74 |
75 // For cross-FileUtil copy/move tests. | 75 // For cross-FileUtil copy/move tests. |
76 other_file_util_.reset(new LocalFileUtil()); | 76 other_file_util_.reset(new LocalFileUtil()); |
77 other_file_util_helper_.SetUp(file_system_context_, other_file_util_.get()); | 77 other_file_util_helper_.SetUp(file_system_context_, other_file_util_.get()); |
78 | 78 |
79 isolated_context()->AddReference(filesystem_id_); | 79 isolated_context()->AddReference(filesystem_id_); |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 EXPECT_EQ(base::PLATFORM_FILE_OK, | 506 EXPECT_EQ(base::PLATFORM_FILE_OK, |
507 file_util()->Truncate(GetOperationContext().get(), url, 999)); | 507 file_util()->Truncate(GetOperationContext().get(), url, 999)); |
508 ASSERT_EQ(base::PLATFORM_FILE_OK, | 508 ASSERT_EQ(base::PLATFORM_FILE_OK, |
509 file_util()->GetFileInfo(GetOperationContext().get(), url, | 509 file_util()->GetFileInfo(GetOperationContext().get(), url, |
510 &info, &platform_path)); | 510 &info, &platform_path)); |
511 EXPECT_EQ(999, info.size); | 511 EXPECT_EQ(999, info.size); |
512 } | 512 } |
513 } | 513 } |
514 | 514 |
515 } // namespace fileapi | 515 } // namespace fileapi |
OLD | NEW |