OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/extensions/api/file_system/file_system_api.h" | |
6 | |
7 #include "base/callback.h" | 5 #include "base/callback.h" |
8 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
10 #include "base/location.h" | 8 #include "base/location.h" |
11 #include "base/macros.h" | 9 #include "base/macros.h" |
12 #include "base/path_service.h" | 10 #include "base/path_service.h" |
13 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
14 #include "chrome/browser/apps/app_browsertest_util.h" | 12 #include "chrome/browser/apps/app_browsertest_util.h" |
15 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 13 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
16 #include "chrome/browser/chromeos/drive/file_system_util.h" | 14 #include "chrome/browser/chromeos/drive/file_system_util.h" |
17 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 15 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
18 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 16 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
19 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 17 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
20 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
21 #include "chrome/browser/extensions/api/file_system/consent_provider.h" | 19 #include "chrome/browser/extensions/api/file_system/consent_provider.h" |
22 #include "chrome/browser/extensions/component_loader.h" | 20 #include "chrome/browser/extensions/component_loader.h" |
23 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
24 #include "chrome/common/extensions/api/file_system.h" | |
25 #include "components/drive/chromeos/file_system_interface.h" | 22 #include "components/drive/chromeos/file_system_interface.h" |
26 #include "components/drive/service/fake_drive_service.h" | 23 #include "components/drive/service/fake_drive_service.h" |
27 #include "content/public/test/test_utils.h" | 24 #include "content/public/test/test_utils.h" |
| 25 #include "extensions/browser/api/file_system/file_system_api.h" |
28 #include "extensions/browser/event_router.h" | 26 #include "extensions/browser/event_router.h" |
| 27 #include "extensions/common/api/file_system.h" |
29 #include "google_apis/drive/base_requests.h" | 28 #include "google_apis/drive/base_requests.h" |
30 #include "google_apis/drive/drive_api_parser.h" | 29 #include "google_apis/drive/drive_api_parser.h" |
31 #include "google_apis/drive/test_util.h" | 30 #include "google_apis/drive/test_util.h" |
32 #include "storage/browser/fileapi/external_mount_points.h" | 31 #include "storage/browser/fileapi/external_mount_points.h" |
33 #include "ui/base/ui_base_types.h" | 32 #include "ui/base/ui_base_types.h" |
34 | 33 |
| 34 // TODO(michaelpg): Port these tests to app_shell: crbug.com/505926. |
| 35 |
35 using file_manager::VolumeManager; | 36 using file_manager::VolumeManager; |
36 | 37 |
37 namespace extensions { | 38 namespace extensions { |
38 namespace { | 39 namespace { |
39 | 40 |
40 // Mount point names for chrome.fileSystem.requestFileSystem() tests. | 41 // Mount point names for chrome.fileSystem.requestFileSystem() tests. |
41 const char kWritableMountPointName[] = "writable"; | 42 const char kWritableMountPointName[] = "writable"; |
42 const char kReadOnlyMountPointName[] = "read-only"; | 43 const char kReadOnlyMountPointName[] = "read-only"; |
43 | 44 |
44 // Child directory created in each of the mount points. | 45 // Child directory created in each of the mount points. |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 profile(), extensions::api::file_system::OnVolumeListChanged::kEventName, | 491 profile(), extensions::api::file_system::OnVolumeListChanged::kEventName, |
491 kTestingExtensionId, | 492 kTestingExtensionId, |
492 base::Bind(&FileSystemApiTestForRequestFileSystem::MountFakeVolume, | 493 base::Bind(&FileSystemApiTestForRequestFileSystem::MountFakeVolume, |
493 base::Unretained(this))); | 494 base::Unretained(this))); |
494 | 495 |
495 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/on_volume_list_changed")) | 496 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/on_volume_list_changed")) |
496 << message_; | 497 << message_; |
497 } | 498 } |
498 | 499 |
499 } // namespace extensions | 500 } // namespace extensions |
OLD | NEW |