OLD | NEW |
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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 class Widget; | 13 class Widget; |
14 } // namespace views | 14 } // namespace views |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
| 18 class UserContext; |
| 19 |
18 namespace test { | 20 namespace test { |
19 | 21 |
20 // ScreenLockerTester provides access to the private state/function | 22 // ScreenLockerTester provides access to the private state/function |
21 // of ScreenLocker class. Used to implement unit tests. | 23 // of ScreenLocker class. Used to implement unit tests. |
22 class ScreenLockerTester { | 24 class ScreenLockerTester { |
23 public: | 25 public: |
24 ScreenLockerTester(); | 26 ScreenLockerTester(); |
25 virtual ~ScreenLockerTester(); | 27 virtual ~ScreenLockerTester(); |
26 | 28 |
27 // Returns true if the screen is locked. | 29 // Returns true if the screen is locked. |
28 virtual bool IsLocked(); | 30 virtual bool IsLocked(); |
29 | 31 |
30 // Injects MockAuthenticate that uses given |user| and |password|. | 32 // Injects MockAuthenticator that uses the credentials in |user_context|. |
31 virtual void InjectMockAuthenticator(const std::string& user, | 33 virtual void InjectMockAuthenticator(const UserContext& user_context); |
32 const std::string& password); | |
33 | 34 |
34 // Sets the password text. | 35 // Sets the password text. |
35 virtual void SetPassword(const std::string& password) = 0; | 36 virtual void SetPassword(const std::string& password) = 0; |
36 | 37 |
37 // Gets the password text. | 38 // Gets the password text. |
38 virtual std::string GetPassword() = 0; | 39 virtual std::string GetPassword() = 0; |
39 | 40 |
40 // Emulates entring a password. | 41 // Emulates entring a password. |
41 virtual void EnterPassword(const std::string& password) = 0; | 42 virtual void EnterPassword(const std::string& password) = 0; |
42 | 43 |
43 // Emulates the ready message from window manager. | 44 // Emulates the ready message from window manager. |
44 virtual void EmulateWindowManagerReady() = 0; | 45 virtual void EmulateWindowManagerReady() = 0; |
45 | 46 |
46 // Returns the widget for screen locker window. | 47 // Returns the widget for screen locker window. |
47 virtual views::Widget* GetWidget() const = 0; | 48 virtual views::Widget* GetWidget() const = 0; |
48 | 49 |
49 virtual views::Widget* GetChildWidget() const = 0; | 50 virtual views::Widget* GetChildWidget() const = 0; |
50 }; | 51 }; |
51 | 52 |
52 } // namespace test | 53 } // namespace test |
53 | 54 |
54 } // namespace chromeos | 55 } // namespace chromeos |
55 | 56 |
56 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_ | 57 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_TESTER_H_ |
OLD | NEW |