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 #include "chrome/browser/chromeos/login/screen_locker_tester.h" | 5 #include "chrome/browser/chromeos/login/screen_locker_tester.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/chromeos/login/mock_authenticator.h" | 11 #include "chrome/browser/chromeos/login/mock_authenticator.h" |
12 #include "chrome/browser/chromeos/login/screen_locker.h" | 12 #include "chrome/browser/chromeos/login/screen_locker.h" |
13 #include "chrome/browser/chromeos/login/screen_lock_view.h" | 13 #include "chrome/browser/chromeos/login/screen_lock_view.h" |
14 #include "views/controls/button/button.h" | 14 #include "views/controls/button/button.h" |
15 #include "views/controls/label.h" | 15 #include "views/controls/label.h" |
16 #include "views/controls/textfield/textfield.h" | 16 #include "views/controls/textfield/textfield.h" |
17 #include "views/widget/widget_gtk.h" | 17 #include "views/widget/widget_gtk.h" |
| 18 #include "views/widget/root_view.h" |
18 | 19 |
19 namespace chromeos { | 20 namespace chromeos { |
20 | 21 |
21 test::ScreenLockerTester* ScreenLocker::GetTester() { | 22 test::ScreenLockerTester* ScreenLocker::GetTester() { |
22 return new test::ScreenLockerTester(); | 23 return new test::ScreenLockerTester(); |
23 } | 24 } |
24 | 25 |
25 namespace test { | 26 namespace test { |
26 | 27 |
27 bool ScreenLockerTester::IsOpen() { | 28 bool ScreenLockerTester::IsLocked() { |
28 return chromeos::ScreenLocker::screen_locker_ != NULL; | 29 return ScreenLocker::screen_locker_ != NULL && |
| 30 ScreenLocker::screen_locker_->lock_widget_->GetRootView()->IsVisible(); |
29 } | 31 } |
30 | 32 |
31 void ScreenLockerTester::InjectMockAuthenticator( | 33 void ScreenLockerTester::InjectMockAuthenticator( |
32 const char* user, const char* password) { | 34 const char* user, const char* password) { |
33 DCHECK(ScreenLocker::screen_locker_); | 35 DCHECK(ScreenLocker::screen_locker_); |
34 ScreenLocker::screen_locker_->SetAuthenticator( | 36 ScreenLocker::screen_locker_->SetAuthenticator( |
35 new MockAuthenticator(ScreenLocker::screen_locker_, user, password)); | 37 new MockAuthenticator(ScreenLocker::screen_locker_, user, password)); |
36 } | 38 } |
37 | 39 |
38 void ScreenLockerTester::EnterPassword(const char* password) { | 40 void ScreenLockerTester::EnterPassword(const char* password) { |
(...skipping 20 matching lines...) Expand all Loading... |
59 } | 61 } |
60 | 62 |
61 views::Widget* ScreenLockerTester::GetWidget() { | 63 views::Widget* ScreenLockerTester::GetWidget() { |
62 DCHECK(ScreenLocker::screen_locker_); | 64 DCHECK(ScreenLocker::screen_locker_); |
63 return ScreenLocker::screen_locker_->lock_window_; | 65 return ScreenLocker::screen_locker_->lock_window_; |
64 } | 66 } |
65 | 67 |
66 } // namespace test | 68 } // namespace test |
67 | 69 |
68 } // namespace chromeos | 70 } // namespace chromeos |
OLD | NEW |