| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/file_manager/file_manager_browsertest_base.h" | 5 #include "chrome/browser/chromeos/file_manager/file_manager_browsertest_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 | 10 |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/json/json_value_converter.h" | 12 #include "base/json/json_value_converter.h" |
| 13 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 16 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/chromeos/drive/file_system_util.h" | 19 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 20 #include "chrome/browser/chromeos/file_manager/app_id.h" |
| 20 #include "chrome/browser/chromeos/file_manager/mount_test_util.h" | 21 #include "chrome/browser/chromeos/file_manager/mount_test_util.h" |
| 21 #include "chrome/browser/chromeos/file_manager/path_util.h" | 22 #include "chrome/browser/chromeos/file_manager/path_util.h" |
| 22 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 23 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| 24 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 23 #include "chrome/browser/extensions/component_loader.h" | 25 #include "chrome/browser/extensions/component_loader.h" |
| 26 #include "chrome/browser/extensions/extension_service.h" |
| 24 #include "chrome/browser/notifications/notification.h" | 27 #include "chrome/browser/notifications/notification.h" |
| 25 #include "chrome/browser/notifications/notification_ui_manager.h" | 28 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 26 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 27 #include "chromeos/chromeos_switches.h" | 30 #include "chromeos/chromeos_switches.h" |
| 28 #include "components/drive/chromeos/file_system_interface.h" | 31 #include "components/drive/chromeos/file_system_interface.h" |
| 29 #include "components/drive/service/fake_drive_service.h" | 32 #include "components/drive/service/fake_drive_service.h" |
| 30 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 31 #include "content/public/test/test_utils.h" | 34 #include "content/public/test/test_utils.h" |
| 32 #include "extensions/browser/api/test/test_api.h" | 35 #include "extensions/browser/api/test/test_api.h" |
| 36 #include "extensions/browser/extension_system.h" |
| 33 #include "extensions/browser/notification_types.h" | 37 #include "extensions/browser/notification_types.h" |
| 34 #include "google_apis/drive/drive_api_parser.h" | 38 #include "google_apis/drive/drive_api_parser.h" |
| 35 #include "google_apis/drive/test_util.h" | 39 #include "google_apis/drive/test_util.h" |
| 36 #include "net/test/embedded_test_server/embedded_test_server.h" | 40 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 37 #include "storage/browser/fileapi/external_mount_points.h" | 41 #include "storage/browser/fileapi/external_mount_points.h" |
| 38 | 42 |
| 39 namespace file_manager { | 43 namespace file_manager { |
| 40 namespace { | 44 namespace { |
| 41 | 45 |
| 42 enum EntryType { | 46 enum EntryType { |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 522 |
| 519 void FileManagerBrowserTestBase::SetUp() { | 523 void FileManagerBrowserTestBase::SetUp() { |
| 520 net::NetworkChangeNotifier::SetTestNotificationsOnly(true); | 524 net::NetworkChangeNotifier::SetTestNotificationsOnly(true); |
| 521 ExtensionApiTest::SetUp(); | 525 ExtensionApiTest::SetUp(); |
| 522 } | 526 } |
| 523 | 527 |
| 524 void FileManagerBrowserTestBase::SetUpOnMainThread() { | 528 void FileManagerBrowserTestBase::SetUpOnMainThread() { |
| 525 ExtensionApiTest::SetUpOnMainThread(); | 529 ExtensionApiTest::SetUpOnMainThread(); |
| 526 ASSERT_TRUE(local_volume_->Mount(profile())); | 530 ASSERT_TRUE(local_volume_->Mount(profile())); |
| 527 | 531 |
| 532 // The file manager component app should have been added for loading into the |
| 533 // user profile, but not into the sign-in profile. |
| 534 ASSERT_TRUE(extensions::ExtensionSystem::Get(profile()) |
| 535 ->extension_service() |
| 536 ->component_loader() |
| 537 ->Exists(kFileManagerAppId)); |
| 538 ASSERT_FALSE(extensions::ExtensionSystem::Get( |
| 539 chromeos::ProfileHelper::GetSigninProfile()) |
| 540 ->extension_service() |
| 541 ->component_loader() |
| 542 ->Exists(kFileManagerAppId)); |
| 543 |
| 528 if (GetGuestModeParam() != IN_GUEST_MODE) { | 544 if (GetGuestModeParam() != IN_GUEST_MODE) { |
| 529 // Install the web server to serve the mocked share dialog. | 545 // Install the web server to serve the mocked share dialog. |
| 530 ASSERT_TRUE(embedded_test_server()->Start()); | 546 ASSERT_TRUE(embedded_test_server()->Start()); |
| 531 const GURL share_url_base(embedded_test_server()->GetURL( | 547 const GURL share_url_base(embedded_test_server()->GetURL( |
| 532 "/chromeos/file_manager/share_dialog_mock/index.html")); | 548 "/chromeos/file_manager/share_dialog_mock/index.html")); |
| 533 drive_volume_ = drive_volumes_[profile()->GetOriginalProfile()]; | 549 drive_volume_ = drive_volumes_[profile()->GetOriginalProfile()]; |
| 534 drive_volume_->ConfigureShareUrlBase(share_url_base); | 550 drive_volume_->ConfigureShareUrlBase(share_url_base); |
| 535 test_util::WaitUntilDriveMountPointIsAdded(profile()); | 551 test_util::WaitUntilDriveMountPointIsAdded(profile()); |
| 536 } | 552 } |
| 537 } | 553 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 } | 751 } |
| 736 | 752 |
| 737 drive::DriveIntegrationService* | 753 drive::DriveIntegrationService* |
| 738 FileManagerBrowserTestBase::CreateDriveIntegrationService(Profile* profile) { | 754 FileManagerBrowserTestBase::CreateDriveIntegrationService(Profile* profile) { |
| 739 drive_volumes_[profile->GetOriginalProfile()].reset(new DriveTestVolume()); | 755 drive_volumes_[profile->GetOriginalProfile()].reset(new DriveTestVolume()); |
| 740 return drive_volumes_[profile->GetOriginalProfile()] | 756 return drive_volumes_[profile->GetOriginalProfile()] |
| 741 ->CreateDriveIntegrationService(profile); | 757 ->CreateDriveIntegrationService(profile); |
| 742 } | 758 } |
| 743 | 759 |
| 744 } // namespace file_manager | 760 } // namespace file_manager |
| OLD | NEW |