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