| 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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 #endif | 1217 #endif |
| 1218 WRAPPED_INSTANTIATE_TEST_CASE_P( | 1218 WRAPPED_INSTANTIATE_TEST_CASE_P( |
| 1219 MAYBE_ShowGridView, | 1219 MAYBE_ShowGridView, |
| 1220 FileManagerBrowserTest, | 1220 FileManagerBrowserTest, |
| 1221 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "showGridViewDownloads"), | 1221 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "showGridViewDownloads"), |
| 1222 TestParameter(IN_GUEST_MODE, "showGridViewDownloads"), | 1222 TestParameter(IN_GUEST_MODE, "showGridViewDownloads"), |
| 1223 TestParameter(NOT_IN_GUEST_MODE, "showGridViewDrive"))); | 1223 TestParameter(NOT_IN_GUEST_MODE, "showGridViewDrive"))); |
| 1224 | 1224 |
| 1225 // Structure to describe an account info. | 1225 // Structure to describe an account info. |
| 1226 struct TestAccountInfo { | 1226 struct TestAccountInfo { |
| 1227 const char* const gaia_id; |
| 1227 const char* const email; | 1228 const char* const email; |
| 1228 const char* const hash; | 1229 const char* const hash; |
| 1229 const char* const display_name; | 1230 const char* const display_name; |
| 1230 }; | 1231 }; |
| 1231 | 1232 |
| 1232 enum { | 1233 enum { |
| 1233 DUMMY_ACCOUNT_INDEX = 0, | 1234 DUMMY_ACCOUNT_INDEX = 0, |
| 1234 PRIMARY_ACCOUNT_INDEX = 1, | 1235 PRIMARY_ACCOUNT_INDEX = 1, |
| 1235 SECONDARY_ACCOUNT_INDEX_START = 2, | 1236 SECONDARY_ACCOUNT_INDEX_START = 2, |
| 1236 }; | 1237 }; |
| 1237 | 1238 |
| 1238 static const TestAccountInfo kTestAccounts[] = { | 1239 static const TestAccountInfo kTestAccounts[] = { |
| 1239 {"__dummy__@invalid.domain", "hashdummy", "Dummy Account"}, | 1240 {"gaia-id-d", "__dummy__@invalid.domain", "hashdummy", "Dummy Account"}, |
| 1240 {"alice@invalid.domain", "hashalice", "Alice"}, | 1241 {"gaia-id-a", "alice@invalid.domain", "hashalice", "Alice"}, |
| 1241 {"bob@invalid.domain", "hashbob", "Bob"}, | 1242 {"gaia-id-b", "bob@invalid.domain", "hashbob", "Bob"}, |
| 1242 {"charlie@invalid.domain", "hashcharlie", "Charlie"}, | 1243 {"gaia-id-c", "charlie@invalid.domain", "hashcharlie", "Charlie"}, |
| 1243 }; | 1244 }; |
| 1244 | 1245 |
| 1245 // Test fixture class for testing multi-profile features. | 1246 // Test fixture class for testing multi-profile features. |
| 1246 class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase { | 1247 class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase { |
| 1247 protected: | 1248 protected: |
| 1248 // Enables multi-profiles. | 1249 // Enables multi-profiles. |
| 1249 void SetUpCommandLine(base::CommandLine* command_line) override { | 1250 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1250 FileManagerBrowserTestBase::SetUpCommandLine(command_line); | 1251 FileManagerBrowserTestBase::SetUpCommandLine(command_line); |
| 1251 // Logs in to a dummy profile (For making MultiProfileWindowManager happy; | 1252 // Logs in to a dummy profile (For making MultiProfileWindowManager happy; |
| 1252 // browser test creates a default window and the manager tries to assign a | 1253 // browser test creates a default window and the manager tries to assign a |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 | 1286 |
| 1286 // Adds a new user for testing to the current session. | 1287 // Adds a new user for testing to the current session. |
| 1287 void AddUser(const TestAccountInfo& info, bool log_in) { | 1288 void AddUser(const TestAccountInfo& info, bool log_in) { |
| 1288 user_manager::UserManager* const user_manager = | 1289 user_manager::UserManager* const user_manager = |
| 1289 user_manager::UserManager::Get(); | 1290 user_manager::UserManager::Get(); |
| 1290 if (log_in) | 1291 if (log_in) |
| 1291 user_manager->UserLoggedIn(info.email, info.hash, false); | 1292 user_manager->UserLoggedIn(info.email, info.hash, false); |
| 1292 user_manager->SaveUserDisplayName(info.email, | 1293 user_manager->SaveUserDisplayName(info.email, |
| 1293 base::UTF8ToUTF16(info.display_name)); | 1294 base::UTF8ToUTF16(info.display_name)); |
| 1294 SigninManagerFactory::GetForProfile( | 1295 SigninManagerFactory::GetForProfile( |
| 1295 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash))-> | 1296 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) |
| 1296 SetAuthenticatedUsername(info.email); | 1297 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); |
| 1297 } | 1298 } |
| 1298 | 1299 |
| 1299 private: | 1300 private: |
| 1300 GuestMode GetGuestModeParam() const override { return NOT_IN_GUEST_MODE; } | 1301 GuestMode GetGuestModeParam() const override { return NOT_IN_GUEST_MODE; } |
| 1301 | 1302 |
| 1302 const char* GetTestCaseNameParam() const override { | 1303 const char* GetTestCaseNameParam() const override { |
| 1303 return test_case_name_.c_str(); | 1304 return test_case_name_.c_str(); |
| 1304 } | 1305 } |
| 1305 | 1306 |
| 1306 std::string test_case_name_; | 1307 std::string test_case_name_; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 StartTest(); | 1543 StartTest(); |
| 1543 } | 1544 } |
| 1544 | 1545 |
| 1545 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { | 1546 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { |
| 1546 set_test_case_name("openSingleVideoOnDrive"); | 1547 set_test_case_name("openSingleVideoOnDrive"); |
| 1547 StartTest(); | 1548 StartTest(); |
| 1548 } | 1549 } |
| 1549 | 1550 |
| 1550 } // namespace | 1551 } // namespace |
| 1551 } // namespace file_manager | 1552 } // namespace file_manager |
| OLD | NEW |