OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 Profile* GetProfileByIndex(int index) { | 1187 Profile* GetProfileByIndex(int index) { |
1188 return chromeos::ProfileHelper::GetProfileByUserIdHash( | 1188 return chromeos::ProfileHelper::GetProfileByUserIdHash( |
1189 kTestAccounts[index].hash); | 1189 kTestAccounts[index].hash); |
1190 } | 1190 } |
1191 | 1191 |
1192 // Adds a new user for testing to the current session. | 1192 // Adds a new user for testing to the current session. |
1193 void AddUser(const TestAccountInfo& info, bool log_in) { | 1193 void AddUser(const TestAccountInfo& info, bool log_in) { |
1194 user_manager::UserManager* const user_manager = | 1194 user_manager::UserManager* const user_manager = |
1195 user_manager::UserManager::Get(); | 1195 user_manager::UserManager::Get(); |
1196 if (log_in) | 1196 if (log_in) |
1197 user_manager->UserLoggedIn(AccountId::FromUserEmail(info.email), | 1197 user_manager->UserLoggedIn( |
1198 info.hash, false); | 1198 AccountId::FromUserEmailGaiaId(info.email, info.gaia_id), info.hash, |
1199 user_manager->SaveUserDisplayName(AccountId::FromUserEmail(info.email), | 1199 false); |
1200 base::UTF8ToUTF16(info.display_name)); | 1200 user_manager->SaveUserDisplayName( |
| 1201 AccountId::FromUserEmailGaiaId(info.email, info.gaia_id), |
| 1202 base::UTF8ToUTF16(info.display_name)); |
1201 SigninManagerFactory::GetForProfile( | 1203 SigninManagerFactory::GetForProfile( |
1202 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) | 1204 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) |
1203 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); | 1205 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); |
1204 } | 1206 } |
1205 }; | 1207 }; |
1206 | 1208 |
1207 IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest, | 1209 IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest, |
1208 PRE_DownloadMultipleFiles) { | 1210 PRE_DownloadMultipleFiles) { |
1209 AddAllUsers(); | 1211 AddAllUsers(); |
1210 } | 1212 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1308 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1307 GetNotification(notification_id_user1)->type()); | 1309 GetNotification(notification_id_user1)->type()); |
1308 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1310 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1309 GetNotification(notification_id_user2_1)->type()); | 1311 GetNotification(notification_id_user2_1)->type()); |
1310 // Normal notifications for user2. | 1312 // Normal notifications for user2. |
1311 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1313 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1312 GetNotification(notification_id_user2_1)->type()); | 1314 GetNotification(notification_id_user2_1)->type()); |
1313 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1315 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
1314 GetNotification(notification_id_user2_2)->type()); | 1316 GetNotification(notification_id_user2_2)->type()); |
1315 } | 1317 } |
OLD | NEW |