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

Unified Diff: ash/test/test_session_state_delegate.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
« no previous file with comments | « ash/system/user/user_view.cc ('k') | chrome/browser/browsing_data/browsing_data_remover_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/test_session_state_delegate.cc
diff --git a/ash/test/test_session_state_delegate.cc b/ash/test/test_session_state_delegate.cc
index bd0bdd37d41f82d795a8e96fd235fd952e5dd0ce..7f2e648d3796a15a18fddb4747b84919cf47ce81 100644
--- a/ash/test/test_session_state_delegate.cc
+++ b/ash/test/test_session_state_delegate.cc
@@ -12,7 +12,6 @@
#include "base/stl_util.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
-#include "components/signin/core/account_id/account_id.h"
#include "components/user_manager/user_info.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -21,20 +20,18 @@
namespace {
-// The the "canonicalized" Account ID from a given |email| address.
-AccountId GetAccountIdFromEmail(const std::string& email) {
+// The the "canonicalized" user ID from a given |email| address.
+std::string GetUserIDFromEmail(const std::string& email) {
std::string user_id = email;
std::transform(user_id.begin(), user_id.end(), user_id.begin(), ::tolower);
- return AccountId::FromUserEmail(user_id);
+ return user_id;
}
} // namespace
class MockUserInfo : public user_manager::UserInfo {
public:
- explicit MockUserInfo(const std::string& display_email)
- : display_email_(display_email),
- account_id_(GetAccountIdFromEmail(display_email)) {}
+ explicit MockUserInfo(const std::string& id) : email_(id) {}
~MockUserInfo() override {}
void SetUserImage(const gfx::ImageSkia& user_image) {
@@ -49,17 +46,18 @@
return base::UTF8ToUTF16("Über Über Über Über");
}
- std::string GetEmail() const override { return display_email_; }
-
- AccountId GetAccountId() const override { return account_id_; }
+ std::string GetEmail() const override { return email_; }
+
+ std::string GetUserID() const override {
+ return GetUserIDFromEmail(GetEmail());
+ }
const gfx::ImageSkia& GetImage() const override { return user_image_; }
// A test user image.
gfx::ImageSkia user_image_;
- std::string display_email_;
- const AccountId account_id_;
+ std::string email_;
DISALLOW_COPY_AND_ASSIGN(MockUserInfo);
};
@@ -217,19 +215,18 @@
}
void TestSessionStateDelegate::SwitchActiveUser(const std::string& user_id) {
- const AccountId account_id(GetAccountIdFromEmail(user_id));
// Make sure this is a user id and not an email address.
- EXPECT_EQ(user_id, account_id.GetUserEmail());
+ EXPECT_EQ(user_id, GetUserIDFromEmail(user_id));
active_user_index_ = 0;
for (std::vector<MockUserInfo*>::iterator iter = user_list_.begin();
iter != user_list_.end();
++iter) {
- if ((*iter)->GetAccountId() == account_id) {
+ if ((*iter)->GetUserID() == user_id) {
active_user_index_ = iter - user_list_.begin();
return;
}
}
- NOTREACHED() << "Unknown user:" << account_id.GetUserEmail();
+ NOTREACHED() << "Unknown user:" << user_id;
}
void TestSessionStateDelegate::CycleActiveUser(CycleUser cycle_user) {
« no previous file with comments | « ash/system/user/user_view.cc ('k') | chrome/browser/browsing_data/browsing_data_remover_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698