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

Side by Side Diff: chrome/browser/download/notification/download_notification_browsertest.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/profiles/profile_helper.h" 10 #include "chrome/browser/chromeos/profiles/profile_helper.h"
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 Profile* GetProfileByIndex(int index) { 1127 Profile* GetProfileByIndex(int index) {
1128 return chromeos::ProfileHelper::GetProfileByUserIdHash( 1128 return chromeos::ProfileHelper::GetProfileByUserIdHash(
1129 kTestAccounts[index].hash); 1129 kTestAccounts[index].hash);
1130 } 1130 }
1131 1131
1132 // Adds a new user for testing to the current session. 1132 // Adds a new user for testing to the current session.
1133 void AddUser(const TestAccountInfo& info, bool log_in) { 1133 void AddUser(const TestAccountInfo& info, bool log_in) {
1134 user_manager::UserManager* const user_manager = 1134 user_manager::UserManager* const user_manager =
1135 user_manager::UserManager::Get(); 1135 user_manager::UserManager::Get();
1136 if (log_in) 1136 if (log_in)
1137 user_manager->UserLoggedIn(info.email, info.hash, false); 1137 user_manager->UserLoggedIn(AccountId::FromUserEmail(info.email),
1138 user_manager->SaveUserDisplayName(info.email, 1138 info.hash, false);
1139 user_manager->SaveUserDisplayName(AccountId::FromUserEmail(info.email),
1139 base::UTF8ToUTF16(info.display_name)); 1140 base::UTF8ToUTF16(info.display_name));
1140 SigninManagerFactory::GetForProfile( 1141 SigninManagerFactory::GetForProfile(
1141 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) 1142 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash))
1142 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); 1143 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email);
1143 } 1144 }
1144 }; 1145 };
1145 1146
1146 IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest, 1147 IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest,
1147 PRE_DownloadMultipleFiles) { 1148 PRE_DownloadMultipleFiles) {
1148 AddAllUsers(); 1149 AddAllUsers();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1243 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1243 GetNotification(notification_id_user1)->type()); 1244 GetNotification(notification_id_user1)->type());
1244 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1245 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1245 GetNotification(notification_id_user2_1)->type()); 1246 GetNotification(notification_id_user2_1)->type());
1246 // Normal notifications for user2. 1247 // Normal notifications for user2.
1247 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1248 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1248 GetNotification(notification_id_user2_1)->type()); 1249 GetNotification(notification_id_user2_1)->type());
1249 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, 1250 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
1250 GetNotification(notification_id_user2_2)->type()); 1251 GetNotification(notification_id_user2_2)->type());
1251 } 1252 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698