| 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 #include "ash/common/session/session_state_delegate.h" | 5 #include "ash/common/session/session_state_delegate.h" |
| 6 #include "ash/common/wm_shell.h" | 6 #include "ash/common/wm_shell.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 10 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h" | 10 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, ScreenVisibility) { | 259 IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, ScreenVisibility) { |
| 260 LoginUser(kTestUsers[0]); | 260 LoginUser(kTestUsers[0]); |
| 261 | 261 |
| 262 UserAddingScreen::Get()->Start(); | 262 UserAddingScreen::Get()->Start(); |
| 263 content::RunAllPendingInMessageLoop(); | 263 content::RunAllPendingInMessageLoop(); |
| 264 CheckScreenIsVisible(); | 264 CheckScreenIsVisible(); |
| 265 UserAddingScreen::Get()->Cancel(); | 265 UserAddingScreen::Get()->Cancel(); |
| 266 WaitUntilUserAddingFinishedOrCancelled(); | 266 WaitUntilUserAddingFinishedOrCancelled(); |
| 267 content::RunAllPendingInMessageLoop(); | 267 content::RunAllPendingInMessageLoop(); |
| 268 | 268 |
| 269 ScreenLocker::Show(); | 269 { |
| 270 content::WindowedNotificationObserver( | 270 content::WindowedNotificationObserver observer( |
| 271 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 271 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 272 content::NotificationService::AllSources()).Wait(); | 272 content::NotificationService::AllSources()); |
| 273 ScreenLocker::Show(); |
| 274 observer.Wait(); |
| 275 } |
| 273 | 276 |
| 274 ScreenLocker::Hide(); | 277 { |
| 275 content::WindowedNotificationObserver( | 278 content::WindowedNotificationObserver observer( |
| 276 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 279 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 277 content::NotificationService::AllSources()).Wait(); | 280 content::NotificationService::AllSources()); |
| 281 ScreenLocker::Hide(); |
| 282 observer.Wait(); |
| 283 } |
| 278 | 284 |
| 279 UserAddingScreen::Get()->Start(); | 285 UserAddingScreen::Get()->Start(); |
| 280 content::RunAllPendingInMessageLoop(); | 286 content::RunAllPendingInMessageLoop(); |
| 281 CheckScreenIsVisible(); | 287 CheckScreenIsVisible(); |
| 282 UserAddingScreen::Get()->Cancel(); | 288 UserAddingScreen::Get()->Cancel(); |
| 283 WaitUntilUserAddingFinishedOrCancelled(); | 289 WaitUntilUserAddingFinishedOrCancelled(); |
| 284 content::RunAllPendingInMessageLoop(); | 290 content::RunAllPendingInMessageLoop(); |
| 285 } | 291 } |
| 286 | 292 |
| 287 } // namespace chromeos | 293 } // namespace chromeos |
| OLD | NEW |