Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: trunk/src/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc

Issue 319633005: Revert 275492 "ChromeOS login webui refactoring : Simplify login..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/chromeos/login/auth/key.h" 13 #include "chrome/browser/chromeos/login/auth/key.h"
14 #include "chrome/browser/chromeos/login/auth/user_context.h" 14 #include "chrome/browser/chromeos/login/auth/user_context.h"
15 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" 15 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h"
16 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" 16 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
17 #include "chrome/browser/chromeos/login/signin_specifics.h"
18 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" 17 #include "chrome/browser/chromeos/login/test/oobe_base_test.h"
19 #include "chrome/browser/chromeos/login/users/user.h" 18 #include "chrome/browser/chromeos/login/users/user.h"
20 #include "chrome/browser/chromeos/login/users/user_manager.h" 19 #include "chrome/browser/chromeos/login/users/user_manager.h"
21 #include "chrome/browser/chromeos/login/wizard_controller.h" 20 #include "chrome/browser/chromeos/login/wizard_controller.h"
22 #include "chrome/browser/extensions/extension_test_message_listener.h" 21 #include "chrome/browser/extensions/extension_test_message_listener.h"
23 #include "chrome/browser/profiles/profile_manager.h" 22 #include "chrome/browser/profiles/profile_manager.h"
24 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 23 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
25 #include "chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h" 24 #include "chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h"
26 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" 25 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h"
27 #include "chrome/browser/ui/browser.h" 26 #include "chrome/browser/ui/browser.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 const std::string& password) { 225 const std::string& password) {
227 ExistingUserController* controller = 226 ExistingUserController* controller =
228 ExistingUserController::current_controller(); 227 ExistingUserController::current_controller();
229 if (!controller) { 228 if (!controller) {
230 ADD_FAILURE(); 229 ADD_FAILURE();
231 return false; 230 return false;
232 } 231 }
233 232
234 UserContext user_context(username); 233 UserContext user_context(username);
235 user_context.SetKey(Key(password)); 234 user_context.SetKey(Key(password));
236 controller->Login(user_context, SigninSpecifics()); 235 controller->Login(user_context);
237 content::WindowedNotificationObserver( 236 content::WindowedNotificationObserver(
238 chrome::NOTIFICATION_SESSION_STARTED, 237 chrome::NOTIFICATION_SESSION_STARTED,
239 content::NotificationService::AllSources()).Wait(); 238 content::NotificationService::AllSources()).Wait();
240 const UserList& logged_users = UserManager::Get()->GetLoggedInUsers(); 239 const UserList& logged_users = UserManager::Get()->GetLoggedInUsers();
241 for (UserList::const_iterator it = logged_users.begin(); 240 for (UserList::const_iterator it = logged_users.begin();
242 it != logged_users.end(); ++it) { 241 it != logged_users.end(); ++it) {
243 if ((*it)->email() == username) 242 if ((*it)->email() == username)
244 return true; 243 return true;
245 } 244 }
246 return false; 245 return false;
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 775
777 if (!catcher.GetNextResult()) { 776 if (!catcher.GetNextResult()) {
778 std::string message = catcher.message(); 777 std::string message = catcher.message();
779 ADD_FAILURE() << "Tests failed: " << message; 778 ADD_FAILURE() << "Tests failed: " << message;
780 } 779 }
781 780
782 EXPECT_TRUE(fake_google_.IsPageRequested()); 781 EXPECT_TRUE(fake_google_.IsPageRequested());
783 } 782 }
784 783
785 } // namespace chromeos 784 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698