| 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 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(AccountId::FromUserEmail(info.email), | 1137 user_manager->UserLoggedIn(info.email, info.hash, false); |
| 1138 info.hash, false); | 1138 user_manager->SaveUserDisplayName(info.email, |
| 1139 user_manager->SaveUserDisplayName(AccountId::FromUserEmail(info.email), | |
| 1140 base::UTF8ToUTF16(info.display_name)); | 1139 base::UTF8ToUTF16(info.display_name)); |
| 1141 SigninManagerFactory::GetForProfile( | 1140 SigninManagerFactory::GetForProfile( |
| 1142 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) | 1141 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) |
| 1143 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); | 1142 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); |
| 1144 } | 1143 } |
| 1145 }; | 1144 }; |
| 1146 | 1145 |
| 1147 IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest, | 1146 IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest, |
| 1148 PRE_DownloadMultipleFiles) { | 1147 PRE_DownloadMultipleFiles) { |
| 1149 AddAllUsers(); | 1148 AddAllUsers(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1242 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 1244 GetNotification(notification_id_user1)->type()); | 1243 GetNotification(notification_id_user1)->type()); |
| 1245 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1244 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 1246 GetNotification(notification_id_user2_1)->type()); | 1245 GetNotification(notification_id_user2_1)->type()); |
| 1247 // Normal notifications for user2. | 1246 // Normal notifications for user2. |
| 1248 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1247 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 1249 GetNotification(notification_id_user2_1)->type()); | 1248 GetNotification(notification_id_user2_1)->type()); |
| 1250 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 1249 EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
| 1251 GetNotification(notification_id_user2_2)->type()); | 1250 GetNotification(notification_id_user2_2)->type()); |
| 1252 } | 1251 } |
| OLD | NEW |