1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/chromeos/login/test_login_utils.h" 6 7 #include "base/logging.h" 8 #include "chrome/browser/chromeos/login/auth/mock_authenticator.h" 9 #include "chrome/browser/chromeos/login/auth/user_context.h" 10 11 namespace chromeos { 12 13 TestLoginUtils::TestLoginUtils(const UserContext& user_context) 14 : expected_user_context_(user_context) { 15 } 16 17 TestLoginUtils::~TestLoginUtils() {} 18 19 void TestLoginUtils::PrepareProfile( 20 const UserContext& user_context, 21 bool has_cookies, 22 bool has_active_session, 23 Delegate* delegate) { 24 if (user_context != expected_user_context_) 25 NOTREACHED(); 26 // Profile hasn't been loaded. 27 delegate->OnProfilePrepared(NULL); 28 } 29 30 void TestLoginUtils::DelegateDeleted(Delegate* delegate) { 31 } 32 33 scoped_refptr<Authenticator> TestLoginUtils::CreateAuthenticator( 34 LoginStatusConsumer* consumer) { 35 return new MockAuthenticator(consumer, expected_user_context_); 36 } 37 38 } // namespace chromeos 39