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