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 #include "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
6 #include "chrome/browser/chromeos/drive/file_system_util.h" | 6 #include "chrome/browser/chromeos/drive/file_system_util.h" |
7 #include "chrome/browser/chromeos/file_manager/file_manager_browsertest_base.h" | 7 #include "chrome/browser/chromeos/file_manager/file_manager_browsertest_base.h" |
8 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 8 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
9 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 return profile ? profile : FileManagerBrowserTestBase::profile(); | 602 return profile ? profile : FileManagerBrowserTestBase::profile(); |
603 } | 603 } |
604 | 604 |
605 // Sets the test case name (used as a function name in test_cases.js to call.) | 605 // Sets the test case name (used as a function name in test_cases.js to call.) |
606 void set_test_case_name(const std::string& name) { test_case_name_ = name; } | 606 void set_test_case_name(const std::string& name) { test_case_name_ = name; } |
607 | 607 |
608 // Adds a new user for testing to the current session. | 608 // Adds a new user for testing to the current session. |
609 void AddUser(const TestAccountInfo& info, bool log_in) { | 609 void AddUser(const TestAccountInfo& info, bool log_in) { |
610 user_manager::UserManager* const user_manager = | 610 user_manager::UserManager* const user_manager = |
611 user_manager::UserManager::Get(); | 611 user_manager::UserManager::Get(); |
| 612 const AccountId account_id(AccountId::FromUserEmail(info.email)); |
612 if (log_in) | 613 if (log_in) |
613 user_manager->UserLoggedIn(info.email, info.hash, false); | 614 user_manager->UserLoggedIn(account_id, info.hash, false); |
614 user_manager->SaveUserDisplayName(info.email, | 615 user_manager->SaveUserDisplayName(account_id, |
615 base::UTF8ToUTF16(info.display_name)); | 616 base::UTF8ToUTF16(info.display_name)); |
616 SigninManagerFactory::GetForProfile( | 617 SigninManagerFactory::GetForProfile( |
617 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) | 618 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) |
618 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); | 619 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); |
619 } | 620 } |
620 | 621 |
621 private: | 622 private: |
622 GuestMode GetGuestModeParam() const override { return NOT_IN_GUEST_MODE; } | 623 GuestMode GetGuestModeParam() const override { return NOT_IN_GUEST_MODE; } |
623 const char* GetTestManifestName() const override { | 624 const char* GetTestManifestName() const override { |
624 return "file_manager_test_manifest.json"; | 625 return "file_manager_test_manifest.json"; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 668 |
668 IN_PROC_BROWSER_TEST_F(MultiProfileFileManagerBrowserTest, MAYBE_BasicDrive) { | 669 IN_PROC_BROWSER_TEST_F(MultiProfileFileManagerBrowserTest, MAYBE_BasicDrive) { |
669 AddAllUsers(); | 670 AddAllUsers(); |
670 | 671 |
671 // Sanity check that normal operations work in multi-profile setting as well. | 672 // Sanity check that normal operations work in multi-profile setting as well. |
672 set_test_case_name("keyboardCopyDrive"); | 673 set_test_case_name("keyboardCopyDrive"); |
673 StartTest(); | 674 StartTest(); |
674 } | 675 } |
675 | 676 |
676 } // namespace file_manager | 677 } // namespace file_manager |
OLD | NEW |