| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 bool AddUserToSession(const AccountId& account_id, | 257 bool AddUserToSession(const AccountId& account_id, |
| 258 const std::string& password) { | 258 const std::string& password) { |
| 259 ExistingUserController* controller = | 259 ExistingUserController* controller = |
| 260 ExistingUserController::current_controller(); | 260 ExistingUserController::current_controller(); |
| 261 if (!controller) { | 261 if (!controller) { |
| 262 ADD_FAILURE(); | 262 ADD_FAILURE(); |
| 263 return false; | 263 return false; |
| 264 } | 264 } |
| 265 | 265 |
| 266 UserContext user_context(account_id); | 266 UserContext user_context(account_id); |
| 267 user_context.SetGaiaID(account_id.GetGaiaId()); | |
| 268 user_context.SetKey(Key(password)); | 267 user_context.SetKey(Key(password)); |
| 269 controller->Login(user_context, SigninSpecifics()); | 268 controller->Login(user_context, SigninSpecifics()); |
| 270 content::WindowedNotificationObserver( | 269 content::WindowedNotificationObserver( |
| 271 chrome::NOTIFICATION_SESSION_STARTED, | 270 chrome::NOTIFICATION_SESSION_STARTED, |
| 272 content::NotificationService::AllSources()).Wait(); | 271 content::NotificationService::AllSources()).Wait(); |
| 273 const user_manager::UserList& logged_users = | 272 const user_manager::UserList& logged_users = |
| 274 user_manager::UserManager::Get()->GetLoggedInUsers(); | 273 user_manager::UserManager::Get()->GetLoggedInUsers(); |
| 275 for (user_manager::UserList::const_iterator it = logged_users.begin(); | 274 for (user_manager::UserList::const_iterator it = logged_users.begin(); |
| 276 it != logged_users.end(); | 275 it != logged_users.end(); |
| 277 ++it) { | 276 ++it) { |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 | 805 |
| 807 if (!catcher.GetNextResult()) { | 806 if (!catcher.GetNextResult()) { |
| 808 std::string message = catcher.message(); | 807 std::string message = catcher.message(); |
| 809 ADD_FAILURE() << "Tests failed: " << message; | 808 ADD_FAILURE() << "Tests failed: " << message; |
| 810 } | 809 } |
| 811 | 810 |
| 812 EXPECT_TRUE(fake_google_.IsPageRequested()); | 811 EXPECT_TRUE(fake_google_.IsPageRequested()); |
| 813 } | 812 } |
| 814 | 813 |
| 815 } // namespace chromeos | 814 } // namespace chromeos |
| OLD | NEW |