OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_SCREEN_LOCKER_TESTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_TESTER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_TESTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_TESTER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
11 class Button; | 11 class Button; |
12 class Textfield; | 12 class Textfield; |
13 class Widget; | 13 class Widget; |
14 } // namespace views | 14 } // namespace views |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
18 class ScreenLocker; | 18 class ScreenLocker; |
19 | 19 |
20 namespace test { | 20 namespace test { |
21 | 21 |
22 // ScreenLockerTester provides access to the private state/function | 22 // ScreenLockerTester provides access to the private state/function |
23 // of ScreenLocker class. Used to implement unit tests. | 23 // of ScreenLocker class. Used to implement unit tests. |
24 class ScreenLockerTester { | 24 class ScreenLockerTester { |
25 public: | 25 public: |
26 // Returns true if the screen lock is open. | 26 // Returns true if the screen is locked. |
27 bool IsOpen(); | 27 bool IsLocked(); |
28 | 28 |
29 // Injects MockAuthenticate that uses given |user| and |password|. | 29 // Injects MockAuthenticate that uses given |user| and |password|. |
30 void InjectMockAuthenticator(const char* user, const char* password); | 30 void InjectMockAuthenticator(const char* user, const char* password); |
31 | 31 |
32 // Emulates entring a password. | 32 // Emulates entring a password. |
33 void EnterPassword(const char* password); | 33 void EnterPassword(const char* password); |
34 | 34 |
35 // Emulates the ready message from window manager. | 35 // Emulates the ready message from window manager. |
36 void EmulateWindowManagerReady(); | 36 void EmulateWindowManagerReady(); |
37 | 37 |
38 // Returns the widget for screen locker window. | 38 // Returns the widget for screen locker window. |
39 views::Widget* GetWidget(); | 39 views::Widget* GetWidget(); |
40 | 40 |
41 private: | 41 private: |
42 friend class chromeos::ScreenLocker; | 42 friend class chromeos::ScreenLocker; |
43 | 43 |
44 ScreenLockerTester() {} | 44 ScreenLockerTester() {} |
45 | 45 |
46 views::Textfield* GetPasswordField(); | 46 views::Textfield* GetPasswordField(); |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(ScreenLockerTester); | 48 DISALLOW_COPY_AND_ASSIGN(ScreenLockerTester); |
49 }; | 49 }; |
50 | 50 |
51 } // namespace test | 51 } // namespace test |
52 | 52 |
53 } // namespace chromeos | 53 } // namespace chromeos |
54 | 54 |
55 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_TESTER_H_ | 55 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_TESTER_H_ |
OLD | NEW |