OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MOCK_BASE_SCREEN_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_BUILDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MOCK_BASE_SCREEN_DELEGATE_H_ | 6 #define CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_BUILDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/chromeos/login/screens/base_screen.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | |
12 #include "testing/gmock/include/gmock/gmock.h" | |
13 | 11 |
14 namespace chromeos { | 12 #include "components/signin/core/browser/fake_signin_manager.h" |
15 | 13 |
16 // Interface that handles notifications received from any of login wizard | 14 namespace content { |
17 // screens. | 15 class BrowserContext; |
18 class MockBaseScreenDelegate : public BaseScreenDelegate { | 16 } |
| 17 |
| 18 class KeyedService; |
| 19 class Profile; |
| 20 |
| 21 // Helper function to be used with KeyedService::SetTestingFactory(). |
| 22 // In order to match the API of SigninManagerFactory::GetForProfile(), returns a |
| 23 // FakeSigninManagerBase* on ChromeOS, and a FakeSigninManager* on all other |
| 24 // platforms. The returned instance is initialized. |
| 25 scoped_ptr<KeyedService> BuildFakeSigninManagerBase( |
| 26 content::BrowserContext* context); |
| 27 |
| 28 class FakeSigninManagerForTesting |
| 29 #if defined(OS_CHROMEOS) |
| 30 : public FakeSigninManagerBase { |
| 31 #else |
| 32 : public FakeSigninManager { |
| 33 #endif |
| 34 |
19 public: | 35 public: |
20 MockBaseScreenDelegate(); | 36 FakeSigninManagerForTesting(Profile* profile); |
21 virtual ~MockBaseScreenDelegate(); | |
22 | |
23 MOCK_METHOD3(OnExit, | |
24 void(BaseScreen&, ExitCodes, const ::login::ScreenContext*)); | |
25 MOCK_METHOD0(ShowCurrentScreen, void()); | |
26 MOCK_METHOD0(GetErrorScreen, ErrorScreen*()); | |
27 MOCK_METHOD0(ShowErrorScreen, void()); | |
28 MOCK_METHOD1(HideErrorScreen, void(BaseScreen*)); | |
29 }; | 37 }; |
30 | 38 |
31 } // namespace chromeos | 39 #endif // CHROME_BROWSER_SIGNIN_FAKE_SIGNIN_MANAGER_BUILDER_H_ |
32 | |
33 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MOCK_BASE_SCREEN_DELEGATE_H_ | |
OLD | NEW |