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/mock_login_utils.h" 6 7 using namespace testing; 8 9 namespace chromeos { 10 11 MockLoginUtils::MockLoginUtils() {} 12 13 MockLoginUtils::~MockLoginUtils() {} 14 15 void MockLoginUtils::DelegateToFake() { 16 if (fake_login_utils_.get()) 17 return; 18 fake_login_utils_.reset(new FakeLoginUtils()); 19 FakeLoginUtils* fake = fake_login_utils_.get(); 20 ON_CALL(*this, DoBrowserLaunch(_, _)) 21 .WillByDefault(Invoke(fake, &FakeLoginUtils::DoBrowserLaunch)); 22 ON_CALL(*this, PrepareProfile(_, _, _, _, _)) 23 .WillByDefault(Invoke(fake, &FakeLoginUtils::PrepareProfile)); 24 ON_CALL(*this, CreateAuthenticator(_)) 25 .WillByDefault(Invoke(fake, &FakeLoginUtils::CreateAuthenticator)); 26 } 27 28 FakeLoginUtils* MockLoginUtils::GetFakeLoginUtils() { 29 return fake_login_utils_.get(); 30 } 31 32 } // namespace chromeos 33