OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/login/login_manager_test.h" | 5 #include "chrome/browser/chromeos/login/login_manager_test.h" |
6 | 6 |
7 #include "base/prefs/scoped_user_pref_update.h" | 7 #include "base/prefs/scoped_user_pref_update.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/chromeos/login/auth/key.h" | 10 #include "chrome/browser/chromeos/login/auth/key.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return false; | 72 return false; |
73 } | 73 } |
74 | 74 |
75 bool LoginManagerTest::AddUserToSession(const UserContext& user_context) { | 75 bool LoginManagerTest::AddUserToSession(const UserContext& user_context) { |
76 ExistingUserController* controller = | 76 ExistingUserController* controller = |
77 ExistingUserController::current_controller(); | 77 ExistingUserController::current_controller(); |
78 if (!controller) { | 78 if (!controller) { |
79 ADD_FAILURE(); | 79 ADD_FAILURE(); |
80 return false; | 80 return false; |
81 } | 81 } |
82 controller->Login(user_context, SigninSpecifics()); | 82 controller->Login(user_context); |
83 content::WindowedNotificationObserver( | 83 content::WindowedNotificationObserver( |
84 chrome::NOTIFICATION_SESSION_STARTED, | 84 chrome::NOTIFICATION_SESSION_STARTED, |
85 content::NotificationService::AllSources()).Wait(); | 85 content::NotificationService::AllSources()).Wait(); |
86 const UserList& logged_users = UserManager::Get()->GetLoggedInUsers(); | 86 const UserList& logged_users = UserManager::Get()->GetLoggedInUsers(); |
87 for (UserList::const_iterator it = logged_users.begin(); | 87 for (UserList::const_iterator it = logged_users.begin(); |
88 it != logged_users.end(); ++it) { | 88 it != logged_users.end(); ++it) { |
89 if ((*it)->email() == user_context.GetUserID()) | 89 if ((*it)->email() == user_context.GetUserID()) |
90 return true; | 90 return true; |
91 } | 91 } |
92 return false; | 92 return false; |
(...skipping 22 matching lines...) Expand all Loading... |
115 EXPECT_TRUE(host != NULL); | 115 EXPECT_TRUE(host != NULL); |
116 | 116 |
117 content::WebContents* web_contents = | 117 content::WebContents* web_contents = |
118 host->GetWebUILoginView()->GetWebContents(); | 118 host->GetWebUILoginView()->GetWebContents(); |
119 EXPECT_TRUE(web_contents != NULL); | 119 EXPECT_TRUE(web_contents != NULL); |
120 set_web_contents(web_contents); | 120 set_web_contents(web_contents); |
121 js_checker_.set_web_contents(web_contents); | 121 js_checker_.set_web_contents(web_contents); |
122 } | 122 } |
123 | 123 |
124 } // namespace chromeos | 124 } // namespace chromeos |
OLD | NEW |