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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc

Issue 1412813003: 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: Fix Win GN build. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
index 44eded23d77c87dd2f18ad99cad777ec68f819fa..6d3d08c1cd664b0012690a9788851f4cbcbe3760 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -63,6 +63,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile_manager.h"
+#include "components/signin/core/account_id/account_id.h"
#include "components/user_manager/fake_user_manager.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/test_utils.h"
@@ -808,22 +809,23 @@ class MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest
// Creates a profile for a given |user_name|. Note that this class will keep
// the ownership of the created object.
TestingProfile* CreateMultiUserProfile(const std::string& user_name) {
- std::string email_string = user_name + "@example.com";
+ const std::string email_string = user_name + "@example.com";
+ const AccountId account_id(AccountId::FromUserEmail(email_string));
static_cast<ash::test::TestSessionStateDelegate*>(
ash::Shell::GetInstance()->session_state_delegate())
- ->AddUser(email_string);
+ ->AddUser(account_id.GetUserEmail());
// Add a user to the fake user manager.
- session_delegate()->AddUser(email_string);
- GetFakeUserManager()->AddUser(email_string);
+ session_delegate()->AddUser(account_id.GetUserEmail());
+ GetFakeUserManager()->AddUser(account_id);
- GetFakeUserManager()->LoginUser(email_string);
+ GetFakeUserManager()->LoginUser(account_id);
TestingProfile* profile =
- profile_manager()->CreateTestingProfile(email_string);
+ profile_manager()->CreateTestingProfile(account_id.GetUserEmail());
EXPECT_TRUE(profile);
// Remember the profile name so that we can destroy it upon destruction.
- created_profiles_[profile] = email_string;
+ created_profiles_[profile] = account_id.GetUserEmail();
if (chrome::MultiUserWindowManager::GetInstance())
chrome::MultiUserWindowManager::GetInstance()->AddUser(profile);
if (launcher_controller_)
@@ -833,18 +835,19 @@ class MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest
// Switch to another user.
void SwitchActiveUser(const std::string& name) {
- session_delegate()->SwitchActiveUser(name);
- GetFakeUserManager()->SwitchActiveUser(name);
+ const AccountId account_id(AccountId::FromUserEmail(name));
+ session_delegate()->SwitchActiveUser(account_id.GetUserEmail());
+ GetFakeUserManager()->SwitchActiveUser(account_id);
chrome::MultiUserWindowManagerChromeOS* manager =
static_cast<chrome::MultiUserWindowManagerChromeOS*>(
chrome::MultiUserWindowManager::GetInstance());
manager->SetAnimationSpeedForTest(
chrome::MultiUserWindowManagerChromeOS::ANIMATION_SPEED_DISABLED);
- manager->ActiveUserChanged(name);
- launcher_controller_->browser_status_monitor_for_test()->
- ActiveUserChanged(name);
- launcher_controller_->app_window_controller_for_test()->
- ActiveUserChanged(name);
+ manager->ActiveUserChanged(account_id.GetUserEmail());
+ launcher_controller_->browser_status_monitor_for_test()->ActiveUserChanged(
+ account_id.GetUserEmail());
+ launcher_controller_->app_window_controller_for_test()->ActiveUserChanged(
+ account_id.GetUserEmail());
}
// Creates a browser with a |profile| and load a tab with a |title| and |url|.
« no previous file with comments | « chrome/browser/sync/sync_ui_util.cc ('k') | chrome/browser/ui/ash/multi_user/multi_user_context_menu_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698