| 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 "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 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 Profile* GetProfileByIndex(int index) { | 1120 Profile* GetProfileByIndex(int index) { |
| 1121 return chromeos::ProfileHelper::GetProfileByUserIdHash( | 1121 return chromeos::ProfileHelper::GetProfileByUserIdHash( |
| 1122 kTestAccounts[index].hash); | 1122 kTestAccounts[index].hash); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 // Adds a new user for testing to the current session. | 1125 // Adds a new user for testing to the current session. |
| 1126 void AddUser(const TestAccountInfo& info, bool log_in) { | 1126 void AddUser(const TestAccountInfo& info, bool log_in) { |
| 1127 user_manager::UserManager* const user_manager = | 1127 user_manager::UserManager* const user_manager = |
| 1128 user_manager::UserManager::Get(); | 1128 user_manager::UserManager::Get(); |
| 1129 if (log_in) | 1129 if (log_in) |
| 1130 user_manager->UserLoggedIn(info.email, info.hash, false); | 1130 user_manager->UserLoggedIn(AccountId::FromUserEmail(info.email), |
| 1131 user_manager->SaveUserDisplayName(info.email, | 1131 info.hash, false); |
| 1132 user_manager->SaveUserDisplayName(AccountId::FromUserEmail(info.email), |
| 1132 base::UTF8ToUTF16(info.display_name)); | 1133 base::UTF8ToUTF16(info.display_name)); |
| 1133 SigninManagerFactory::GetForProfile( | 1134 SigninManagerFactory::GetForProfile( |
| 1134 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) | 1135 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) |
| 1135 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); | 1136 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); |
| 1136 } | 1137 } |
| 1137 }; | 1138 }; |
| 1138 | 1139 |
| 1139 IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest, | 1140 IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest, |
| 1140 PRE_DownloadMultipleFiles) { | 1141 PRE_DownloadMultipleFiles) { |
| 1141 AddAllUsers(); | 1142 AddAllUsers(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1236 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 1236 GetNotification(notification_id_user1)->type()); | 1237 GetNotification(notification_id_user1)->type()); |
| 1237 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1238 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 1238 GetNotification(notification_id_user2_1)->type()); | 1239 GetNotification(notification_id_user2_1)->type()); |
| 1239 // Normal notifications for user2. | 1240 // Normal notifications for user2. |
| 1240 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1241 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 1241 GetNotification(notification_id_user2_1)->type()); | 1242 GetNotification(notification_id_user2_1)->type()); |
| 1242 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1243 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 1243 GetNotification(notification_id_user2_2)->type()); | 1244 GetNotification(notification_id_user2_2)->type()); |
| 1244 } | 1245 } |
| OLD | NEW |