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

Unified Diff: chrome/browser/chromeos/login/signin/oauth2_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, 2 months 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/chromeos/login/signin/oauth2_browsertest.cc
diff --git a/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc b/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc
index 3c224239332714891d3712c9497ff3cfbaffad00..b83bb0c22a8d2d137771d0e2220522dafb186334 100644
--- a/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc
+++ b/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc
@@ -29,7 +29,6 @@
#include "chromeos/login/auth/user_context.h"
#include "components/app_modal/javascript_app_modal_dialog.h"
#include "components/app_modal/native_app_modal_dialog.h"
-#include "components/signin/core/account_id/account_id.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/user_manager/user.h"
@@ -198,9 +197,7 @@
user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
// Try login. Primary profile has changed.
- EXPECT_TRUE(
- TryToLogin(AccountId::FromUserEmailGaiaId(kTestEmail, kTestGaiaId),
- kTestAccountPassword));
+ EXPECT_TRUE(TryToLogin(kTestGaiaId, kTestEmail, kTestAccountPassword));
Profile* profile = ProfileManager::GetPrimaryUserProfile();
// Wait for the session merge to finish.
@@ -215,13 +212,15 @@
user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
}
- bool TryToLogin(const AccountId& account_id, const std::string& password) {
- if (!AddUserToSession(account_id, password))
+ bool TryToLogin(const std::string& gaia_id,
+ const std::string& username,
+ const std::string& password) {
+ if (!AddUserToSession(gaia_id, username, password))
return false;
if (const user_manager::User* active_user =
user_manager::UserManager::Get()->GetActiveUser()) {
- return active_user->GetAccountId() == account_id;
+ return active_user->email() == username;
}
return false;
@@ -252,7 +251,8 @@
return OobeBaseTest::profile();
}
- bool AddUserToSession(const AccountId& account_id,
+ bool AddUserToSession(const std::string& gaia_id,
+ const std::string& username,
const std::string& password) {
ExistingUserController* controller =
ExistingUserController::current_controller();
@@ -261,8 +261,8 @@
return false;
}
- UserContext user_context(account_id);
- user_context.SetGaiaID(account_id.GetGaiaId());
+ UserContext user_context(username);
+ user_context.SetGaiaID(gaia_id);
user_context.SetKey(Key(password));
controller->Login(user_context, SigninSpecifics());
content::WindowedNotificationObserver(
@@ -273,7 +273,7 @@
for (user_manager::UserList::const_iterator it = logged_users.begin();
it != logged_users.end();
++it) {
- if ((*it)->GetAccountId() == account_id)
+ if ((*it)->email() == username)
return true;
}
return false;
@@ -494,9 +494,7 @@
EXPECT_EQ(GetOAuthStatusFromLocalState(account_id),
user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
- EXPECT_TRUE(
- TryToLogin(AccountId::FromUserEmailGaiaId(kTestEmail, kTestGaiaId),
- kTestAccountPassword));
+ EXPECT_TRUE(TryToLogin(kTestGaiaId, kTestEmail, kTestAccountPassword));
// Wait for the session merge to finish.
WaitForMergeSessionCompletion(OAuth2LoginManager::SESSION_RESTORE_FAILED);

Powered by Google App Engine
This is Rietveld 408576698