| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "ash/common/login_status.h" | 8 #include "ash/common/login_status.h" |
| 9 #include "ash/common/strings/grit/ash_strings.h" | 9 #include "ash/common/strings/grit/ash_strings.h" |
| 10 #include "ash/common/system/date/date_default_view.h" | 10 #include "ash/common/system/date/date_default_view.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // Bring up the locker screen. | 223 // Bring up the locker screen. |
| 224 ScreenLocker::Show(); | 224 ScreenLocker::Show(); |
| 225 std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester()); | 225 std::unique_ptr<test::ScreenLockerTester> tester(ScreenLocker::GetTester()); |
| 226 tester->EmulateWindowManagerReady(); | 226 tester->EmulateWindowManagerReady(); |
| 227 content::WindowedNotificationObserver lock_state_observer( | 227 content::WindowedNotificationObserver lock_state_observer( |
| 228 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 228 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 229 content::NotificationService::AllSources()); | 229 content::NotificationService::AllSources()); |
| 230 if (!tester->IsLocked()) | 230 if (!tester->IsLocked()) |
| 231 lock_state_observer.Wait(); | 231 lock_state_observer.Wait(); |
| 232 ScreenLocker* screen_locker = ScreenLocker::default_screen_locker(); | 232 ScreenLocker* screen_locker = ScreenLocker::default_screen_locker(); |
| 233 WebUIScreenLocker* web_ui_screen_locker = | 233 WebUIScreenLocker* web_ui_screen_locker = screen_locker->web_ui(); |
| 234 static_cast<WebUIScreenLocker*>(screen_locker->delegate()); | |
| 235 ASSERT_TRUE(web_ui_screen_locker); | 234 ASSERT_TRUE(web_ui_screen_locker); |
| 236 content::WebUI* web_ui = web_ui_screen_locker->GetWebUI(); | 235 content::WebUI* web_ui = web_ui_screen_locker->GetWebUI(); |
| 237 ASSERT_TRUE(web_ui); | 236 ASSERT_TRUE(web_ui); |
| 238 contents_ = web_ui->GetWebContents(); | 237 contents_ = web_ui->GetWebContents(); |
| 239 ASSERT_TRUE(contents_); | 238 ASSERT_TRUE(contents_); |
| 240 | 239 |
| 241 // Wait for the login UI to be ready. | 240 // Wait for the login UI to be ready. |
| 242 WaitUntilOobeUIIsReady( | 241 WaitUntilOobeUIIsReady(web_ui_screen_locker->GetOobeUI()); |
| 243 static_cast<OobeUI*>(web_ui->GetController())); | |
| 244 } | 242 } |
| 245 | 243 |
| 246 private: | 244 private: |
| 247 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; | 245 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; |
| 248 FakeSessionManagerClient* fake_session_manager_client_; | 246 FakeSessionManagerClient* fake_session_manager_client_; |
| 249 | 247 |
| 250 DISALLOW_COPY_AND_ASSIGN(ShutdownPolicyLockerTest); | 248 DISALLOW_COPY_AND_ASSIGN(ShutdownPolicyLockerTest); |
| 251 }; | 249 }; |
| 252 | 250 |
| 253 IN_PROC_BROWSER_TEST_F(ShutdownPolicyLockerTest, TestBasic) { | 251 IN_PROC_BROWSER_TEST_F(ShutdownPolicyLockerTest, TestBasic) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 PrepareAndRunScript("restart-header-bar-item", false); | 325 PrepareAndRunScript("restart-header-bar-item", false); |
| 328 PrepareAndRunScript("shutdown-header-bar-item", true); | 326 PrepareAndRunScript("shutdown-header-bar-item", true); |
| 329 | 327 |
| 330 UpdateRebootOnShutdownPolicy(false); | 328 UpdateRebootOnShutdownPolicy(false); |
| 331 RefreshDevicePolicy(); | 329 RefreshDevicePolicy(); |
| 332 PrepareAndRunScript("restart-header-bar-item", true); | 330 PrepareAndRunScript("restart-header-bar-item", true); |
| 333 PrepareAndRunScript("shutdown-header-bar-item", false); | 331 PrepareAndRunScript("shutdown-header-bar-item", false); |
| 334 } | 332 } |
| 335 | 333 |
| 336 } // namespace chromeos | 334 } // namespace chromeos |
| OLD | NEW |