| 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" | 8 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" |
| 9 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 9 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
| 10 #include "chrome/browser/chromeos/login/mock_authenticator.h" | 10 #include "chrome/browser/chromeos/login/mock_authenticator.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 tester->EmulateWindowManagerReady(); | 172 tester->EmulateWindowManagerReady(); |
| 173 ui_test_utils::WindowedNotificationObserver lock_state_observer( | 173 ui_test_utils::WindowedNotificationObserver lock_state_observer( |
| 174 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 174 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 175 content::NotificationService::AllSources()); | 175 content::NotificationService::AllSources()); |
| 176 if (!chromeos::ScreenLocker::GetTester()->IsLocked()) | 176 if (!chromeos::ScreenLocker::GetTester()->IsLocked()) |
| 177 lock_state_observer.Wait(); | 177 lock_state_observer.Wait(); |
| 178 | 178 |
| 179 // Test to make sure that the widget is actually appearing and is of | 179 // Test to make sure that the widget is actually appearing and is of |
| 180 // reasonable size, preventing a regression of | 180 // reasonable size, preventing a regression of |
| 181 // http://code.google.com/p/chromium-os/issues/detail?id=5987 | 181 // http://code.google.com/p/chromium-os/issues/detail?id=5987 |
| 182 gfx::Rect lock_bounds = tester->GetChildWidget()->GetWindowScreenBounds(); | 182 gfx::Rect lock_bounds = tester->GetChildWidget()->GetWindowBoundsInScreen(); |
| 183 EXPECT_GT(lock_bounds.width(), 10); | 183 EXPECT_GT(lock_bounds.width(), 10); |
| 184 EXPECT_GT(lock_bounds.height(), 10); | 184 EXPECT_GT(lock_bounds.height(), 10); |
| 185 | 185 |
| 186 tester->InjectMockAuthenticator(UserManager::kStubUser, "pass"); | 186 tester->InjectMockAuthenticator(UserManager::kStubUser, "pass"); |
| 187 EXPECT_TRUE(tester->IsLocked()); | 187 EXPECT_TRUE(tester->IsLocked()); |
| 188 tester->EnterPassword("fail"); | 188 tester->EnterPassword("fail"); |
| 189 ui_test_utils::RunAllPendingInMessageLoop(); | 189 ui_test_utils::RunAllPendingInMessageLoop(); |
| 190 EXPECT_TRUE(tester->IsLocked()); | 190 EXPECT_TRUE(tester->IsLocked()); |
| 191 tester->EnterPassword("pass"); | 191 tester->EnterPassword("pass"); |
| 192 ui_test_utils::RunAllPendingInMessageLoop(); | 192 ui_test_utils::RunAllPendingInMessageLoop(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 ui_test_utils::RunAllPendingInMessageLoop(); | 276 ui_test_utils::RunAllPendingInMessageLoop(); |
| 277 EXPECT_EQ("", tester->GetPassword()); | 277 EXPECT_EQ("", tester->GetPassword()); |
| 278 | 278 |
| 279 // Close the locker to match expectations. | 279 // Close the locker to match expectations. |
| 280 ScreenLocker::Hide(); | 280 ScreenLocker::Hide(); |
| 281 ui_test_utils::RunAllPendingInMessageLoop(); | 281 ui_test_utils::RunAllPendingInMessageLoop(); |
| 282 EXPECT_FALSE(tester->IsLocked()); | 282 EXPECT_FALSE(tester->IsLocked()); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace chromeos | 285 } // namespace chromeos |
| OLD | NEW |