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

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

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. Created 4 years, 9 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
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 #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
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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 804
806 if (!catcher.GetNextResult()) { 805 if (!catcher.GetNextResult()) {
807 std::string message = catcher.message(); 806 std::string message = catcher.message();
808 ADD_FAILURE() << "Tests failed: " << message; 807 ADD_FAILURE() << "Tests failed: " << message;
809 } 808 }
810 809
811 EXPECT_TRUE(fake_google_.IsPageRequested()); 810 EXPECT_TRUE(fake_google_.IsPageRequested());
812 } 811 }
813 812
814 } // namespace chromeos 813 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698