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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 Profile* const profile = chromeos::ProfileHelper::GetProfileByUserIdHash( | 1114 Profile* const profile = chromeos::ProfileHelper::GetProfileByUserIdHash( |
1115 kTestAccounts[PRIMARY_ACCOUNT_INDEX].hash); | 1115 kTestAccounts[PRIMARY_ACCOUNT_INDEX].hash); |
1116 return profile ? profile : FileManagerBrowserTestBase::profile(); | 1116 return profile ? profile : FileManagerBrowserTestBase::profile(); |
1117 } | 1117 } |
1118 | 1118 |
1119 // Sets the test case name (used as a function name in test_cases.js to call.) | 1119 // Sets the test case name (used as a function name in test_cases.js to call.) |
1120 void set_test_case_name(const std::string& name) { test_case_name_ = name; } | 1120 void set_test_case_name(const std::string& name) { test_case_name_ = name; } |
1121 | 1121 |
1122 // Adds a new user for testing to the current session. | 1122 // Adds a new user for testing to the current session. |
1123 void AddUser(const TestAccountInfo& info, bool log_in) { | 1123 void AddUser(const TestAccountInfo& info, bool log_in) { |
1124 chromeos::UserManager* const user_manager = chromeos::UserManager::Get(); | 1124 user_manager::UserManager* const user_manager = |
| 1125 user_manager::UserManager::Get(); |
1125 if (log_in) | 1126 if (log_in) |
1126 user_manager->UserLoggedIn(info.email, info.hash, false); | 1127 user_manager->UserLoggedIn(info.email, info.hash, false); |
1127 user_manager->SaveUserDisplayName(info.email, | 1128 user_manager->SaveUserDisplayName(info.email, |
1128 base::UTF8ToUTF16(info.display_name)); | 1129 base::UTF8ToUTF16(info.display_name)); |
1129 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)->GetPrefs()-> | 1130 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)->GetPrefs()-> |
1130 SetString(prefs::kGoogleServicesUsername, info.email); | 1131 SetString(prefs::kGoogleServicesUsername, info.email); |
1131 } | 1132 } |
1132 | 1133 |
1133 private: | 1134 private: |
1134 virtual GuestMode GetGuestModeParam() const OVERRIDE { | 1135 virtual GuestMode GetGuestModeParam() const OVERRIDE { |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 } | 1443 } |
1443 | 1444 |
1444 IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, ExposureImageOnDrive) { | 1445 IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, ExposureImageOnDrive) { |
1445 AddScript("gallery/photo_editor.js"); | 1446 AddScript("gallery/photo_editor.js"); |
1446 set_test_case_name("exposureImageOnDrive"); | 1447 set_test_case_name("exposureImageOnDrive"); |
1447 StartTest(); | 1448 StartTest(); |
1448 } | 1449 } |
1449 | 1450 |
1450 } // namespace | 1451 } // namespace |
1451 } // namespace file_manager | 1452 } // namespace file_manager |
OLD | NEW |