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 "base/stl_util.h" | 5 #include "base/stl_util.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "webkit/browser/fileapi/file_system_context.h" | 7 #include "webkit/browser/fileapi/file_system_context.h" |
8 #include "webkit/browser/fileapi/file_system_file_util.h" | 8 #include "webkit/browser/fileapi/file_system_file_util.h" |
9 #include "webkit/browser/fileapi/file_system_operation_context.h" | 9 #include "webkit/browser/fileapi/file_system_operation_context.h" |
10 #include "webkit/browser/fileapi/file_system_task_runners.h" | 10 #include "webkit/browser/fileapi/file_system_task_runners.h" |
11 #include "webkit/browser/fileapi/isolated_context.h" | 11 #include "webkit/browser/fileapi/isolated_context.h" |
12 #include "webkit/browser/fileapi/local_file_system_operation.h" | 12 #include "webkit/browser/fileapi/local_file_system_operation.h" |
13 #include "webkit/browser/fileapi/sandbox_file_system_test_helper.h" | 13 #include "webkit/browser/fileapi/sandbox_file_system_test_helper.h" |
14 #include "webkit/browser/fileapi/syncable/canned_syncable_file_system.h" | 14 #include "webkit/browser/fileapi/syncable/canned_syncable_file_system.h" |
15 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" | 15 #include "webkit/browser/fileapi/syncable/local_file_change_tracker.h" |
16 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" | 16 #include "webkit/browser/fileapi/syncable/local_file_sync_context.h" |
| 17 #include "webkit/browser/fileapi/syncable/sync_file_system_backend.h" |
17 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" | 18 #include "webkit/browser/fileapi/syncable/syncable_file_system_util.h" |
18 #include "webkit/browser/quota/quota_manager.h" | 19 #include "webkit/browser/quota/quota_manager.h" |
19 #include "webkit/common/fileapi/file_system_types.h" | 20 #include "webkit/common/fileapi/file_system_types.h" |
20 #include "webkit/common/quota/quota_types.h" | 21 #include "webkit/common/quota/quota_types.h" |
21 | 22 |
22 using base::PlatformFileError; | 23 using base::PlatformFileError; |
23 using fileapi::FileSystemContext; | 24 using fileapi::FileSystemContext; |
24 using fileapi::FileSystemOperationContext; | 25 using fileapi::FileSystemOperationContext; |
25 using fileapi::FileSystemURL; | 26 using fileapi::FileSystemURL; |
26 using fileapi::FileSystemURLSet; | 27 using fileapi::FileSystemURLSet; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 82 |
82 FileSystemURL URL(const std::string& path) { | 83 FileSystemURL URL(const std::string& path) { |
83 return file_system_.URL(path); | 84 return file_system_.URL(path); |
84 } | 85 } |
85 | 86 |
86 FileSystemContext* file_system_context() { | 87 FileSystemContext* file_system_context() { |
87 return file_system_.file_system_context(); | 88 return file_system_.file_system_context(); |
88 } | 89 } |
89 | 90 |
90 LocalFileChangeTracker* change_tracker() { | 91 LocalFileChangeTracker* change_tracker() { |
91 return file_system_context()->change_tracker(); | 92 return file_system_.backend()->change_tracker(); |
92 } | 93 } |
93 | 94 |
94 ScopedEnableSyncFSDirectoryOperation enable_directory_operation_; | 95 ScopedEnableSyncFSDirectoryOperation enable_directory_operation_; |
95 | 96 |
96 base::ScopedTempDir data_dir_; | 97 base::ScopedTempDir data_dir_; |
97 base::MessageLoop message_loop_; | 98 base::MessageLoop message_loop_; |
98 | 99 |
99 CannedSyncableFileSystem file_system_; | 100 CannedSyncableFileSystem file_system_; |
100 scoped_refptr<LocalFileSyncContext> sync_context_; | 101 scoped_refptr<LocalFileSyncContext> sync_context_; |
101 | 102 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // Now try copying the directory into the syncable file system, which should | 282 // Now try copying the directory into the syncable file system, which should |
282 // fail if directory operation is disabled. (http://crbug.com/161442) | 283 // fail if directory operation is disabled. (http://crbug.com/161442) |
283 EXPECT_NE(base::PLATFORM_FILE_OK, | 284 EXPECT_NE(base::PLATFORM_FILE_OK, |
284 file_system_.Copy(kSrcDir, URL("dest"))); | 285 file_system_.Copy(kSrcDir, URL("dest"))); |
285 | 286 |
286 other_file_system_.TearDown(); | 287 other_file_system_.TearDown(); |
287 SetEnableSyncFSDirectoryOperation(was_enabled); | 288 SetEnableSyncFSDirectoryOperation(was_enabled); |
288 } | 289 } |
289 | 290 |
290 } // namespace sync_file_system | 291 } // namespace sync_file_system |
OLD | NEW |