| 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/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.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/chromeos/drive/drive_integration_service.h" | 11 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 12 #include "chrome/browser/chromeos/drive/file_system_util.h" | 12 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 13 #include "chrome/browser/chromeos/file_manager/mount_test_util.h" | 13 #include "chrome/browser/chromeos/file_manager/mount_test_util.h" |
| 14 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 14 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 16 #include "chrome/browser/extensions/extension_apitest.h" | 16 #include "chrome/browser/extensions/extension_apitest.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/common/chrome_constants.h" | 20 #include "chrome/common/chrome_constants.h" |
| 21 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
| 22 #include "components/drive/service/fake_drive_service.h" | 22 #include "components/drive/service/fake_drive_service.h" |
| 23 #include "components/user_manager/user_manager.h" | 23 #include "components/session_manager/core/session_manager.h" |
| 24 #include "content/public/browser/browser_context.h" | 24 #include "content/public/browser/browser_context.h" |
| 25 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
| 26 #include "content/public/test/test_utils.h" | 26 #include "content/public/test/test_utils.h" |
| 27 #include "extensions/browser/notification_types.h" | 27 #include "extensions/browser/notification_types.h" |
| 28 #include "extensions/test/result_catcher.h" | 28 #include "extensions/test/result_catcher.h" |
| 29 #include "google_apis/drive/drive_api_parser.h" | 29 #include "google_apis/drive/drive_api_parser.h" |
| 30 #include "google_apis/drive/test_util.h" | 30 #include "google_apis/drive/test_util.h" |
| 31 #include "google_apis/drive/time_util.h" | 31 #include "google_apis/drive/time_util.h" |
| 32 #include "storage/browser/fileapi/external_mount_points.h" | 32 #include "storage/browser/fileapi/external_mount_points.h" |
| 33 #include "ui/shell_dialogs/select_file_dialog_factory.h" | 33 #include "ui/shell_dialogs/select_file_dialog_factory.h" |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 560 |
| 561 // Tests for Drive file systems in multi-profile setting. | 561 // Tests for Drive file systems in multi-profile setting. |
| 562 class MultiProfileDriveFileSystemExtensionApiTest : | 562 class MultiProfileDriveFileSystemExtensionApiTest : |
| 563 public FileSystemExtensionApiTestBase { | 563 public FileSystemExtensionApiTestBase { |
| 564 public: | 564 public: |
| 565 MultiProfileDriveFileSystemExtensionApiTest() : second_profile_(NULL) {} | 565 MultiProfileDriveFileSystemExtensionApiTest() : second_profile_(NULL) {} |
| 566 | 566 |
| 567 void SetUpOnMainThread() override { | 567 void SetUpOnMainThread() override { |
| 568 base::FilePath user_data_directory; | 568 base::FilePath user_data_directory; |
| 569 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); | 569 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); |
| 570 user_manager::UserManager::Get()->UserLoggedIn( | 570 session_manager::SessionManager::Get()->CreateSession( |
| 571 AccountId::FromUserEmail(kSecondProfileAccount), kSecondProfileHash, | 571 AccountId::FromUserEmail(kSecondProfileAccount), kSecondProfileHash); |
| 572 false); | |
| 573 // Set up the secondary profile. | 572 // Set up the secondary profile. |
| 574 base::FilePath profile_dir = | 573 base::FilePath profile_dir = |
| 575 user_data_directory.Append( | 574 user_data_directory.Append( |
| 576 chromeos::ProfileHelper::GetUserProfileDir( | 575 chromeos::ProfileHelper::GetUserProfileDir( |
| 577 kSecondProfileHash).BaseName()); | 576 kSecondProfileHash).BaseName()); |
| 578 second_profile_ = | 577 second_profile_ = |
| 579 g_browser_process->profile_manager()->GetProfile(profile_dir); | 578 g_browser_process->profile_manager()->GetProfile(profile_dir); |
| 580 | 579 |
| 581 FileSystemExtensionApiTestBase::SetUpOnMainThread(); | 580 FileSystemExtensionApiTestBase::SetUpOnMainThread(); |
| 582 } | 581 } |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 AppFileHandlerMulti) { | 855 AppFileHandlerMulti) { |
| 857 EXPECT_TRUE( | 856 EXPECT_TRUE( |
| 858 RunFileSystemExtensionApiTest("file_browser/app_file_handler_multi", | 857 RunFileSystemExtensionApiTest("file_browser/app_file_handler_multi", |
| 859 FILE_PATH_LITERAL("manifest.json"), | 858 FILE_PATH_LITERAL("manifest.json"), |
| 860 "", | 859 "", |
| 861 FLAGS_NONE)) | 860 FLAGS_NONE)) |
| 862 << message_; | 861 << message_; |
| 863 } | 862 } |
| 864 } // namespace | 863 } // namespace |
| 865 } // namespace file_manager | 864 } // namespace file_manager |
| OLD | NEW |