Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: chrome/browser/chromeos/file_manager/file_manager_browsertest.cc

Issue 1425093004: Revert of This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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));
613 if (log_in) 612 if (log_in)
614 user_manager->UserLoggedIn(account_id, info.hash, false); 613 user_manager->UserLoggedIn(info.email, info.hash, false);
615 user_manager->SaveUserDisplayName(account_id, 614 user_manager->SaveUserDisplayName(info.email,
616 base::UTF8ToUTF16(info.display_name)); 615 base::UTF8ToUTF16(info.display_name));
617 SigninManagerFactory::GetForProfile( 616 SigninManagerFactory::GetForProfile(
618 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) 617 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash))
619 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); 618 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email);
620 } 619 }
621 620
622 private: 621 private:
623 GuestMode GetGuestModeParam() const override { return NOT_IN_GUEST_MODE; } 622 GuestMode GetGuestModeParam() const override { return NOT_IN_GUEST_MODE; }
624 const char* GetTestManifestName() const override { 623 const char* GetTestManifestName() const override {
625 return "file_manager_test_manifest.json"; 624 return "file_manager_test_manifest.json";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 667
669 IN_PROC_BROWSER_TEST_F(MultiProfileFileManagerBrowserTest, MAYBE_BasicDrive) { 668 IN_PROC_BROWSER_TEST_F(MultiProfileFileManagerBrowserTest, MAYBE_BasicDrive) {
670 AddAllUsers(); 669 AddAllUsers();
671 670
672 // Sanity check that normal operations work in multi-profile setting as well. 671 // Sanity check that normal operations work in multi-profile setting as well.
673 set_test_case_name("keyboardCopyDrive"); 672 set_test_case_name("keyboardCopyDrive");
674 StartTest(); 673 StartTest();
675 } 674 }
676 675
677 } // namespace file_manager 676 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698