| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | |
| 12 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 11 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 13 #include "chrome/browser/chromeos/file_manager/drive_test_util.h" | 12 #include "chrome/browser/chromeos/file_manager/drive_test_util.h" |
| 14 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 13 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| 15 #include "chrome/browser/chromeos/login/users/user_manager.h" | 14 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 16 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 17 #include "chrome/browser/drive/fake_drive_service.h" | 16 #include "chrome/browser/drive/fake_drive_service.h" |
| 18 #include "chrome/browser/extensions/extension_apitest.h" | 17 #include "chrome/browser/extensions/extension_apitest.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
| 21 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
| 23 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
| 24 #include "content/public/browser/browser_context.h" | 23 #include "content/public/browser/browser_context.h" |
| 25 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
| 26 #include "content/public/test/test_utils.h" | 25 #include "content/public/test/test_utils.h" |
| 26 #include "extensions/browser/notification_types.h" |
| 27 #include "google_apis/drive/drive_api_parser.h" | 27 #include "google_apis/drive/drive_api_parser.h" |
| 28 #include "google_apis/drive/test_util.h" | 28 #include "google_apis/drive/test_util.h" |
| 29 #include "google_apis/drive/time_util.h" | 29 #include "google_apis/drive/time_util.h" |
| 30 #include "webkit/browser/fileapi/external_mount_points.h" | 30 #include "webkit/browser/fileapi/external_mount_points.h" |
| 31 | 31 |
| 32 // Tests for access to external file systems (as defined in | 32 // Tests for access to external file systems (as defined in |
| 33 // webkit/common/fileapi/file_system_types.h) from extensions with | 33 // webkit/common/fileapi/file_system_types.h) from extensions with |
| 34 // fileBrowserPrivate and fileBrowserHandler extension permissions. | 34 // fileBrowserPrivate and fileBrowserHandler extension permissions. |
| 35 // The tests cover following external file system types: | 35 // The tests cover following external file system types: |
| 36 // - local (kFileSystemTypeLocalNative): a local file system on which files are | 36 // - local (kFileSystemTypeLocalNative): a local file system on which files are |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 return false; | 286 return false; |
| 287 (*out_resource_ids)[entry->title()] = entry->file_id(); | 287 (*out_resource_ids)[entry->title()] = entry->file_id(); |
| 288 | 288 |
| 289 return true; | 289 return true; |
| 290 } | 290 } |
| 291 | 291 |
| 292 // Helper class to wait for a background page to load or close again. | 292 // Helper class to wait for a background page to load or close again. |
| 293 class BackgroundObserver { | 293 class BackgroundObserver { |
| 294 public: | 294 public: |
| 295 BackgroundObserver() | 295 BackgroundObserver() |
| 296 : page_created_(chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, | 296 : page_created_(extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, |
| 297 content::NotificationService::AllSources()), | 297 content::NotificationService::AllSources()), |
| 298 page_closed_(chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, | 298 page_closed_(extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
| 299 content::NotificationService::AllSources()) { | 299 content::NotificationService::AllSources()) {} |
| 300 } | |
| 301 | 300 |
| 302 void WaitUntilLoaded() { | 301 void WaitUntilLoaded() { |
| 303 page_created_.Wait(); | 302 page_created_.Wait(); |
| 304 } | 303 } |
| 305 | 304 |
| 306 void WaitUntilClosed() { | 305 void WaitUntilClosed() { |
| 307 page_closed_.Wait(); | 306 page_closed_.Wait(); |
| 308 } | 307 } |
| 309 | 308 |
| 310 private: | 309 private: |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 AppFileHandlerMulti) { | 790 AppFileHandlerMulti) { |
| 792 EXPECT_TRUE( | 791 EXPECT_TRUE( |
| 793 RunFileSystemExtensionApiTest("file_browser/app_file_handler_multi", | 792 RunFileSystemExtensionApiTest("file_browser/app_file_handler_multi", |
| 794 FILE_PATH_LITERAL("manifest.json"), | 793 FILE_PATH_LITERAL("manifest.json"), |
| 795 "", | 794 "", |
| 796 FLAGS_NONE)) | 795 FLAGS_NONE)) |
| 797 << message_; | 796 << message_; |
| 798 } | 797 } |
| 799 } // namespace | 798 } // namespace |
| 800 } // namespace file_manager | 799 } // namespace file_manager |
| OLD | NEW |