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.
5 #ifndef CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_
6 #define CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_
10 #include "base/compiler_specific.h"
11 #include "chrome/browser/signin/signin_manager.h"
14 class BrowserContextKeyedService
;
16 // Overrides InitTokenService to do-nothing in tests.
17 class FakeSigninManagerBase
: public SigninManagerBase
{
19 explicit FakeSigninManagerBase();
20 virtual ~FakeSigninManagerBase();
22 // Helper function to be used with
23 // BrowserContextKeyedService::SetTestingFactory().
24 static BrowserContextKeyedService
* Build(content::BrowserContext
* profile
);
27 #if !defined(OS_CHROMEOS)
29 // A signin manager that bypasses actual authentication routines with servers
30 // and accepts the credentials provided to StartSignIn.
31 class FakeSigninManager
: public SigninManager
{
33 explicit FakeSigninManager(Profile
* profile
);
34 virtual ~FakeSigninManager();
36 void set_auth_in_progress(const std::string
& username
) {
37 possibly_invalid_username_
= username
;
40 virtual void SignOut() OVERRIDE
;
42 virtual void StartSignInWithCredentials(
43 const std::string
& session_index
,
44 const std::string
& username
,
45 const std::string
& password
,
46 const OAuthTokenFetchedCallback
& oauth_fetched_callback
) OVERRIDE
;
48 virtual void CompletePendingSignin() OVERRIDE
;
50 // Helper function to be used with
51 // BrowserContextKeyedService::SetTestingFactory().
52 static BrowserContextKeyedService
* Build(content::BrowserContext
* profile
);
55 #endif // !defined (OS_CHROMEOS)
57 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_H_