| 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 |
| 11 #include <deque> | 11 #include <deque> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "apps/app_window.h" | |
| 15 #include "apps/app_window_registry.h" | |
| 16 #include "base/bind.h" | 14 #include "base/bind.h" |
| 17 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 18 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
| 19 #include "base/json/json_reader.h" | 17 #include "base/json/json_reader.h" |
| 20 #include "base/json/json_value_converter.h" | 18 #include "base/json/json_value_converter.h" |
| 21 #include "base/json/json_writer.h" | 19 #include "base/json/json_writer.h" |
| 22 #include "base/prefs/pref_service.h" | 20 #include "base/prefs/pref_service.h" |
| 23 #include "base/strings/string_piece.h" | 21 #include "base/strings/string_piece.h" |
| 24 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 25 #include "base/time/time.h" | 23 #include "base/time/time.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 37 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
| 38 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 36 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 39 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 37 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 40 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 42 #include "chromeos/chromeos_switches.h" | 40 #include "chromeos/chromeos_switches.h" |
| 43 #include "components/user_manager/user_manager.h" | 41 #include "components/user_manager/user_manager.h" |
| 44 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 45 #include "content/public/test/test_utils.h" | 43 #include "content/public/test/test_utils.h" |
| 46 #include "extensions/browser/api/test/test_api.h" | 44 #include "extensions/browser/api/test/test_api.h" |
| 45 #include "extensions/browser/app_window/app_window.h" |
| 46 #include "extensions/browser/app_window/app_window_registry.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 |
| 54 using drive::DriveIntegrationServiceFactory; | 54 using drive::DriveIntegrationServiceFactory; |
| 55 | 55 |
| 56 namespace file_manager { | 56 namespace file_manager { |
| (...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 virtual std::string OnMessage(const std::string& name, | 1153 virtual std::string OnMessage(const std::string& name, |
| 1154 const base::Value* value) OVERRIDE { | 1154 const base::Value* value) OVERRIDE { |
| 1155 if (name == "addAllUsers") { | 1155 if (name == "addAllUsers") { |
| 1156 AddAllUsers(); | 1156 AddAllUsers(); |
| 1157 return "true"; | 1157 return "true"; |
| 1158 } else if (name == "getWindowOwnerId") { | 1158 } else if (name == "getWindowOwnerId") { |
| 1159 chrome::MultiUserWindowManager* const window_manager = | 1159 chrome::MultiUserWindowManager* const window_manager = |
| 1160 chrome::MultiUserWindowManager::GetInstance(); | 1160 chrome::MultiUserWindowManager::GetInstance(); |
| 1161 apps::AppWindowRegistry* const app_window_registry = | 1161 extensions::AppWindowRegistry* const app_window_registry = |
| 1162 apps::AppWindowRegistry::Get(profile()); | 1162 extensions::AppWindowRegistry::Get(profile()); |
| 1163 DCHECK(window_manager); | 1163 DCHECK(window_manager); |
| 1164 DCHECK(app_window_registry); | 1164 DCHECK(app_window_registry); |
| 1165 | 1165 |
| 1166 const apps::AppWindowRegistry::AppWindowList& list = | 1166 const extensions::AppWindowRegistry::AppWindowList& list = |
| 1167 app_window_registry->GetAppWindowsForApp( | 1167 app_window_registry->GetAppWindowsForApp( |
| 1168 file_manager::kFileManagerAppId); | 1168 file_manager::kFileManagerAppId); |
| 1169 return list.size() == 1u ? | 1169 return list.size() == 1u ? |
| 1170 window_manager->GetUserPresentingWindow( | 1170 window_manager->GetUserPresentingWindow( |
| 1171 list.front()->GetNativeWindow()) : ""; | 1171 list.front()->GetNativeWindow()) : ""; |
| 1172 } | 1172 } |
| 1173 return FileManagerBrowserTestBase::OnMessage(name, value); | 1173 return FileManagerBrowserTestBase::OnMessage(name, value); |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 std::string test_case_name_; | 1176 std::string test_case_name_; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { | 1519 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { |
| 1520 AddScript("video_player/open_video_files.js"); | 1520 AddScript("video_player/open_video_files.js"); |
| 1521 set_test_case_name("openSingleVideoOnDrive"); | 1521 set_test_case_name("openSingleVideoOnDrive"); |
| 1522 StartTest(); | 1522 StartTest(); |
| 1523 } | 1523 } |
| 1524 | 1524 |
| 1525 } // namespace | 1525 } // namespace |
| 1526 } // namespace file_manager | 1526 } // namespace file_manager |
| OLD | NEW |