OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // Browser test for basic Chrome OS file manager functionality: | 5 // Browser test for basic Chrome OS file manager functionality: |
6 // - The file list is updated when a file is added externally to the Downloads | 6 // - The file list is updated when a file is added externally to the Downloads |
7 // folder. | 7 // folder. |
8 // - Selecting a file and copy-pasting it with the keyboard copies the file. | 8 // - Selecting a file and copy-pasting it with the keyboard copies the file. |
9 // - Selecting a file and pressing delete deletes it. | 9 // - Selecting a file and pressing delete deletes it. |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/prefs/pref_service.h" | 22 #include "base/prefs/pref_service.h" |
23 #include "base/strings/string_piece.h" | 23 #include "base/strings/string_piece.h" |
24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
25 #include "base/time/time.h" | 25 #include "base/time/time.h" |
26 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 26 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
27 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 27 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
28 #include "chrome/browser/chromeos/file_manager/app_id.h" | 28 #include "chrome/browser/chromeos/file_manager/app_id.h" |
29 #include "chrome/browser/chromeos/file_manager/drive_test_util.h" | 29 #include "chrome/browser/chromeos/file_manager/drive_test_util.h" |
30 #include "chrome/browser/chromeos/file_manager/path_util.h" | 30 #include "chrome/browser/chromeos/file_manager/path_util.h" |
31 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 31 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
32 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
33 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 32 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
34 #include "chrome/browser/drive/fake_drive_service.h" | 33 #include "chrome/browser/drive/fake_drive_service.h" |
35 #include "chrome/browser/extensions/component_loader.h" | 34 #include "chrome/browser/extensions/component_loader.h" |
36 #include "chrome/browser/extensions/extension_apitest.h" | 35 #include "chrome/browser/extensions/extension_apitest.h" |
37 #include "chrome/browser/extensions/extension_test_message_listener.h" | 36 #include "chrome/browser/extensions/extension_test_message_listener.h" |
38 #include "chrome/browser/profiles/profile.h" | 37 #include "chrome/browser/profiles/profile.h" |
39 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 38 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
40 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 39 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
41 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
43 #include "chromeos/chromeos_switches.h" | 42 #include "chromeos/chromeos_switches.h" |
| 43 #include "components/user_manager/user_manager.h" |
44 #include "content/public/browser/notification_service.h" | 44 #include "content/public/browser/notification_service.h" |
45 #include "content/public/test/test_utils.h" | 45 #include "content/public/test/test_utils.h" |
46 #include "extensions/browser/api/test/test_api.h" | 46 #include "extensions/browser/api/test/test_api.h" |
47 #include "extensions/browser/notification_types.h" | 47 #include "extensions/browser/notification_types.h" |
48 #include "extensions/common/extension.h" | 48 #include "extensions/common/extension.h" |
49 #include "google_apis/drive/drive_api_parser.h" | 49 #include "google_apis/drive/drive_api_parser.h" |
50 #include "google_apis/drive/test_util.h" | 50 #include "google_apis/drive/test_util.h" |
51 #include "net/test/embedded_test_server/embedded_test_server.h" | 51 #include "net/test/embedded_test_server/embedded_test_server.h" |
52 #include "webkit/browser/fileapi/external_mount_points.h" | 52 #include "webkit/browser/fileapi/external_mount_points.h" |
53 | 53 |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 Profile* const profile = chromeos::ProfileHelper::GetProfileByUserIdHash( | 1124 Profile* const profile = chromeos::ProfileHelper::GetProfileByUserIdHash( |
1125 kTestAccounts[PRIMARY_ACCOUNT_INDEX].hash); | 1125 kTestAccounts[PRIMARY_ACCOUNT_INDEX].hash); |
1126 return profile ? profile : FileManagerBrowserTestBase::profile(); | 1126 return profile ? profile : FileManagerBrowserTestBase::profile(); |
1127 } | 1127 } |
1128 | 1128 |
1129 // Sets the test case name (used as a function name in test_cases.js to call.) | 1129 // Sets the test case name (used as a function name in test_cases.js to call.) |
1130 void set_test_case_name(const std::string& name) { test_case_name_ = name; } | 1130 void set_test_case_name(const std::string& name) { test_case_name_ = name; } |
1131 | 1131 |
1132 // Adds a new user for testing to the current session. | 1132 // Adds a new user for testing to the current session. |
1133 void AddUser(const TestAccountInfo& info, bool log_in) { | 1133 void AddUser(const TestAccountInfo& info, bool log_in) { |
1134 chromeos::UserManager* const user_manager = chromeos::UserManager::Get(); | 1134 user_manager::UserManager* const user_manager = |
| 1135 user_manager::UserManager::Get(); |
1135 if (log_in) | 1136 if (log_in) |
1136 user_manager->UserLoggedIn(info.email, info.hash, false); | 1137 user_manager->UserLoggedIn(info.email, info.hash, false); |
1137 user_manager->SaveUserDisplayName(info.email, | 1138 user_manager->SaveUserDisplayName(info.email, |
1138 base::UTF8ToUTF16(info.display_name)); | 1139 base::UTF8ToUTF16(info.display_name)); |
1139 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)->GetPrefs()-> | 1140 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)->GetPrefs()-> |
1140 SetString(prefs::kGoogleServicesUsername, info.email); | 1141 SetString(prefs::kGoogleServicesUsername, info.email); |
1141 } | 1142 } |
1142 | 1143 |
1143 private: | 1144 private: |
1144 virtual GuestMode GetGuestModeParam() const OVERRIDE { | 1145 virtual GuestMode GetGuestModeParam() const OVERRIDE { |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 } | 1453 } |
1453 | 1454 |
1454 IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, ExposureImageOnDrive) { | 1455 IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, ExposureImageOnDrive) { |
1455 AddScript("gallery/photo_editor.js"); | 1456 AddScript("gallery/photo_editor.js"); |
1456 set_test_case_name("exposureImageOnDrive"); | 1457 set_test_case_name("exposureImageOnDrive"); |
1457 StartTest(); | 1458 StartTest(); |
1458 } | 1459 } |
1459 | 1460 |
1460 } // namespace | 1461 } // namespace |
1461 } // namespace file_manager | 1462 } // namespace file_manager |
OLD | NEW |