| 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 "ash/wm/power_button_controller.h" | 5 #include "ash/wm/power_button_controller.h" |
| 6 #include "ash/wm/session_state_animator.h" | 6 #include "ash/wm/session_state_animator.h" |
| 7 #include "ash/wm/session_state_controller.h" | 7 #include "ash/wm/session_state_controller.h" |
| 8 #include "ash/wm/session_state_controller_impl.h" | 8 #include "ash/wm/session_state_controller_impl.h" |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| 11 #include "ash/session_state_delegate.h" |
| 11 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 12 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
| 13 #include "ash/test/test_shell_delegate.h" | 14 #include "ash/test/test_shell_delegate.h" |
| 14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/time.h" | 17 #include "base/time.h" |
| 17 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
| 18 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
| 19 #include "ui/aura/test/event_generator.h" | 20 #include "ui/aura/test/event_generator.h" |
| 20 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 21 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 controller_ = Shell::GetInstance()->power_button_controller(); | 71 controller_ = Shell::GetInstance()->power_button_controller(); |
| 71 state_controller_ = static_cast<SessionStateControllerImpl*>( | 72 state_controller_ = static_cast<SessionStateControllerImpl*>( |
| 72 Shell::GetInstance()->session_state_controller()); | 73 Shell::GetInstance()->session_state_controller()); |
| 73 state_controller_->SetDelegate(delegate_); // transfers ownership | 74 state_controller_->SetDelegate(delegate_); // transfers ownership |
| 74 test_api_.reset(new SessionStateControllerImpl::TestApi(state_controller_)); | 75 test_api_.reset(new SessionStateControllerImpl::TestApi(state_controller_)); |
| 75 animator_api_.reset( | 76 animator_api_.reset( |
| 76 new internal::SessionStateAnimator::TestApi(state_controller_-> | 77 new internal::SessionStateAnimator::TestApi(state_controller_-> |
| 77 animator_.get())); | 78 animator_.get())); |
| 78 shell_delegate_ = reinterpret_cast<TestShellDelegate*>( | 79 shell_delegate_ = reinterpret_cast<TestShellDelegate*>( |
| 79 ash::Shell::GetInstance()->delegate()); | 80 ash::Shell::GetInstance()->delegate()); |
| 81 state_delegate_ = Shell::GetInstance()->session_state_delegate(); |
| 80 } | 82 } |
| 81 | 83 |
| 82 protected: | 84 protected: |
| 83 void GenerateMouseMoveEvent() { | 85 void GenerateMouseMoveEvent() { |
| 84 aura::test::EventGenerator generator( | 86 aura::test::EventGenerator generator( |
| 85 Shell::GetPrimaryRootWindow()); | 87 Shell::GetPrimaryRootWindow()); |
| 86 generator.MoveMouseTo(10, 10); | 88 generator.MoveMouseTo(10, 10); |
| 87 } | 89 } |
| 88 | 90 |
| 89 int NumShutdownRequests() { | 91 int NumShutdownRequests() { |
| 90 return delegate_->num_shutdown_requests() + | 92 return delegate_->num_shutdown_requests() + |
| 91 shell_delegate_->num_exit_requests(); | 93 shell_delegate_->num_exit_requests(); |
| 92 } | 94 } |
| 93 | 95 |
| 94 PowerButtonController* controller_; // not owned | 96 PowerButtonController* controller_; // not owned |
| 95 SessionStateControllerImpl* state_controller_; // not owned | 97 SessionStateControllerImpl* state_controller_; // not owned |
| 96 TestPowerButtonControllerDelegate* delegate_; // not owned | 98 TestPowerButtonControllerDelegate* delegate_; // not owned |
| 97 TestShellDelegate* shell_delegate_; // not owned | 99 TestShellDelegate* shell_delegate_; // not owned |
| 100 SessionStateDelegate* state_delegate_; // not owned |
| 98 | 101 |
| 99 scoped_ptr<SessionStateControllerImpl::TestApi> test_api_; | 102 scoped_ptr<SessionStateControllerImpl::TestApi> test_api_; |
| 100 scoped_ptr<internal::SessionStateAnimator::TestApi> animator_api_; | 103 scoped_ptr<internal::SessionStateAnimator::TestApi> animator_api_; |
| 101 | 104 |
| 102 private: | 105 private: |
| 103 DISALLOW_COPY_AND_ASSIGN(PowerButtonControllerTest); | 106 DISALLOW_COPY_AND_ASSIGN(PowerButtonControllerTest); |
| 104 }; | 107 }; |
| 105 | 108 |
| 106 // Test the lock-to-shutdown flow for non-Chrome-OS hardware that doesn't | 109 // Test the lock-to-shutdown flow for non-Chrome-OS hardware that doesn't |
| 107 // correctly report power button releases. We should lock immediately the first | 110 // correctly report power button releases. We should lock immediately the first |
| (...skipping 24 matching lines...) Expand all Loading... |
| 132 animator_api_->ContainersAreAnimated( | 135 animator_api_->ContainersAreAnimated( |
| 133 internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, | 136 internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, |
| 134 internal::SessionStateAnimator::ANIMATION_FULL_CLOSE)); | 137 internal::SessionStateAnimator::ANIMATION_FULL_CLOSE)); |
| 135 EXPECT_TRUE( | 138 EXPECT_TRUE( |
| 136 animator_api_->ContainersAreAnimated( | 139 animator_api_->ContainersAreAnimated( |
| 137 internal::SessionStateAnimator::LOCK_SCREEN_CONTAINERS, | 140 internal::SessionStateAnimator::LOCK_SCREEN_CONTAINERS, |
| 138 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY)); | 141 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY)); |
| 139 | 142 |
| 140 // Notify that the lock window is visible. We should make it fade in. | 143 // Notify that the lock window is visible. We should make it fade in. |
| 141 state_controller_->OnLockStateChanged(true); | 144 state_controller_->OnLockStateChanged(true); |
| 142 shell_delegate_->LockScreen(); | 145 state_delegate_->LockScreen(); |
| 143 EXPECT_TRUE( | 146 EXPECT_TRUE( |
| 144 animator_api_->ContainersAreAnimated( | 147 animator_api_->ContainersAreAnimated( |
| 145 internal::SessionStateAnimator::kAllLockScreenContainersMask, | 148 internal::SessionStateAnimator::kAllLockScreenContainersMask, |
| 146 internal::SessionStateAnimator::ANIMATION_FADE_IN)); | 149 internal::SessionStateAnimator::ANIMATION_FADE_IN)); |
| 147 | 150 |
| 148 // We shouldn't progress towards the shutdown state, however. | 151 // We shouldn't progress towards the shutdown state, however. |
| 149 EXPECT_FALSE(test_api_->lock_to_shutdown_timer_is_running()); | 152 EXPECT_FALSE(test_api_->lock_to_shutdown_timer_is_running()); |
| 150 EXPECT_FALSE(test_api_->shutdown_timer_is_running()); | 153 EXPECT_FALSE(test_api_->shutdown_timer_is_running()); |
| 151 controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); | 154 controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); |
| 152 | 155 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 animator_api_->ContainersAreAnimated( | 301 animator_api_->ContainersAreAnimated( |
| 299 internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, | 302 internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, |
| 300 internal::SessionStateAnimator::ANIMATION_FULL_CLOSE)); | 303 internal::SessionStateAnimator::ANIMATION_FULL_CLOSE)); |
| 301 EXPECT_TRUE( | 304 EXPECT_TRUE( |
| 302 animator_api_->ContainersAreAnimated( | 305 animator_api_->ContainersAreAnimated( |
| 303 internal::SessionStateAnimator::LOCK_SCREEN_CONTAINERS, | 306 internal::SessionStateAnimator::LOCK_SCREEN_CONTAINERS, |
| 304 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY)); | 307 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY)); |
| 305 | 308 |
| 306 // Notify that the lock window is visible. We should make it fade in. | 309 // Notify that the lock window is visible. We should make it fade in. |
| 307 state_controller_->OnLockStateChanged(true); | 310 state_controller_->OnLockStateChanged(true); |
| 308 shell_delegate_->LockScreen(); | 311 state_delegate_->LockScreen(); |
| 309 EXPECT_TRUE( | 312 EXPECT_TRUE( |
| 310 animator_api_->ContainersAreAnimated( | 313 animator_api_->ContainersAreAnimated( |
| 311 internal::SessionStateAnimator::kAllLockScreenContainersMask, | 314 internal::SessionStateAnimator::kAllLockScreenContainersMask, |
| 312 internal::SessionStateAnimator::ANIMATION_FADE_IN)); | 315 internal::SessionStateAnimator::ANIMATION_FADE_IN)); |
| 313 | 316 |
| 314 // When we release the power button, the lock-to-shutdown timer should be | 317 // When we release the power button, the lock-to-shutdown timer should be |
| 315 // stopped. | 318 // stopped. |
| 316 EXPECT_TRUE(test_api_->lock_to_shutdown_timer_is_running()); | 319 EXPECT_TRUE(test_api_->lock_to_shutdown_timer_is_running()); |
| 317 controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); | 320 controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); |
| 318 EXPECT_FALSE(test_api_->lock_to_shutdown_timer_is_running()); | 321 EXPECT_FALSE(test_api_->lock_to_shutdown_timer_is_running()); |
| 319 | 322 |
| 320 // Notify that the screen has been unlocked. We should show the | 323 // Notify that the screen has been unlocked. We should show the |
| 321 // non-screen-locker windows. | 324 // non-screen-locker windows. |
| 322 state_controller_->OnLockStateChanged(false); | 325 state_controller_->OnLockStateChanged(false); |
| 323 shell_delegate_->UnlockScreen(); | 326 state_delegate_->UnlockScreen(); |
| 324 EXPECT_TRUE( | 327 EXPECT_TRUE( |
| 325 animator_api_->ContainersAreAnimated( | 328 animator_api_->ContainersAreAnimated( |
| 326 internal::SessionStateAnimator::DESKTOP_BACKGROUND | | 329 internal::SessionStateAnimator::DESKTOP_BACKGROUND | |
| 327 internal::SessionStateAnimator::LAUNCHER | | 330 internal::SessionStateAnimator::LAUNCHER | |
| 328 internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, | 331 internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, |
| 329 internal::SessionStateAnimator::ANIMATION_RESTORE)); | 332 internal::SessionStateAnimator::ANIMATION_RESTORE)); |
| 330 } | 333 } |
| 331 | 334 |
| 332 // Hold the power button down from the unlocked state to eventual shutdown. | 335 // Hold the power button down from the unlocked state to eventual shutdown. |
| 333 TEST_F(PowerButtonControllerTest, LockToShutdown) { | 336 TEST_F(PowerButtonControllerTest, LockToShutdown) { |
| 334 controller_->set_has_legacy_power_button_for_test(false); | 337 controller_->set_has_legacy_power_button_for_test(false); |
| 335 state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); | 338 state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); |
| 336 state_controller_->OnLockStateChanged(false); | 339 state_controller_->OnLockStateChanged(false); |
| 337 | 340 |
| 338 // Hold the power button and lock the screen. | 341 // Hold the power button and lock the screen. |
| 339 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); | 342 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
| 340 EXPECT_TRUE(test_api_->lock_timer_is_running()); | 343 EXPECT_TRUE(test_api_->lock_timer_is_running()); |
| 341 test_api_->trigger_lock_timeout(); | 344 test_api_->trigger_lock_timeout(); |
| 342 state_controller_->OnStartingLock(); | 345 state_controller_->OnStartingLock(); |
| 343 state_controller_->OnLockStateChanged(true); | 346 state_controller_->OnLockStateChanged(true); |
| 344 shell_delegate_->LockScreen(); | 347 state_delegate_->LockScreen(); |
| 345 | 348 |
| 346 // When the lock-to-shutdown timeout fires, we should start the shutdown | 349 // When the lock-to-shutdown timeout fires, we should start the shutdown |
| 347 // timer. | 350 // timer. |
| 348 EXPECT_TRUE(test_api_->lock_to_shutdown_timer_is_running()); | 351 EXPECT_TRUE(test_api_->lock_to_shutdown_timer_is_running()); |
| 349 test_api_->trigger_lock_to_shutdown_timeout(); | 352 test_api_->trigger_lock_to_shutdown_timeout(); |
| 350 EXPECT_TRUE(test_api_->shutdown_timer_is_running()); | 353 EXPECT_TRUE(test_api_->shutdown_timer_is_running()); |
| 351 EXPECT_TRUE( | 354 EXPECT_TRUE( |
| 352 animator_api_->ContainersAreAnimated( | 355 animator_api_->ContainersAreAnimated( |
| 353 internal::SessionStateAnimator::kAllContainersMask, | 356 internal::SessionStateAnimator::kAllContainersMask, |
| 354 internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE)); | 357 internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE)); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 372 | 375 |
| 373 // Hold the power button and lock the screen. | 376 // Hold the power button and lock the screen. |
| 374 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); | 377 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
| 375 EXPECT_TRUE(test_api_->lock_timer_is_running()); | 378 EXPECT_TRUE(test_api_->lock_timer_is_running()); |
| 376 test_api_->trigger_lock_timeout(); | 379 test_api_->trigger_lock_timeout(); |
| 377 state_controller_->OnStartingLock(); | 380 state_controller_->OnStartingLock(); |
| 378 | 381 |
| 379 // Power button is released while system attempts to lock. | 382 // Power button is released while system attempts to lock. |
| 380 controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); | 383 controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); |
| 381 state_controller_->OnLockStateChanged(true); | 384 state_controller_->OnLockStateChanged(true); |
| 382 shell_delegate_->LockScreen(); | 385 state_delegate_->LockScreen(); |
| 383 | 386 |
| 384 EXPECT_FALSE(state_controller_->ShutdownRequested()); | 387 EXPECT_FALSE(state_controller_->ShutdownRequested()); |
| 385 EXPECT_FALSE(test_api_->lock_to_shutdown_timer_is_running()); | 388 EXPECT_FALSE(test_api_->lock_to_shutdown_timer_is_running()); |
| 386 EXPECT_FALSE(test_api_->shutdown_timer_is_running()); | 389 EXPECT_FALSE(test_api_->shutdown_timer_is_running()); |
| 387 } | 390 } |
| 388 | 391 |
| 389 // Test that we handle the case where lock requests are ignored. | 392 // Test that we handle the case where lock requests are ignored. |
| 390 TEST_F(PowerButtonControllerTest, LockFail) { | 393 TEST_F(PowerButtonControllerTest, LockFail) { |
| 391 // We require animations to have a duration for this test. | 394 // We require animations to have a duration for this test. |
| 392 ui::ScopedAnimationDurationScaleMode normal_duration_mode( | 395 ui::ScopedAnimationDurationScaleMode normal_duration_mode( |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 // Pressing the lock button while we have a pending lock request shouldn't do | 475 // Pressing the lock button while we have a pending lock request shouldn't do |
| 473 // anything. | 476 // anything. |
| 474 controller_->OnLockButtonEvent(false, base::TimeTicks::Now()); | 477 controller_->OnLockButtonEvent(false, base::TimeTicks::Now()); |
| 475 controller_->OnLockButtonEvent(true, base::TimeTicks::Now()); | 478 controller_->OnLockButtonEvent(true, base::TimeTicks::Now()); |
| 476 EXPECT_FALSE(test_api_->lock_timer_is_running()); | 479 EXPECT_FALSE(test_api_->lock_timer_is_running()); |
| 477 controller_->OnLockButtonEvent(false, base::TimeTicks::Now()); | 480 controller_->OnLockButtonEvent(false, base::TimeTicks::Now()); |
| 478 | 481 |
| 479 // Pressing the button also shouldn't do anything after the screen is locked. | 482 // Pressing the button also shouldn't do anything after the screen is locked. |
| 480 state_controller_->OnStartingLock(); | 483 state_controller_->OnStartingLock(); |
| 481 state_controller_->OnLockStateChanged(true); | 484 state_controller_->OnLockStateChanged(true); |
| 482 shell_delegate_->LockScreen(); | 485 state_delegate_->LockScreen(); |
| 483 controller_->OnLockButtonEvent(true, base::TimeTicks::Now()); | 486 controller_->OnLockButtonEvent(true, base::TimeTicks::Now()); |
| 484 EXPECT_FALSE(test_api_->lock_timer_is_running()); | 487 EXPECT_FALSE(test_api_->lock_timer_is_running()); |
| 485 controller_->OnLockButtonEvent(false, base::TimeTicks::Now()); | 488 controller_->OnLockButtonEvent(false, base::TimeTicks::Now()); |
| 486 } | 489 } |
| 487 | 490 |
| 488 // Test that the power button takes priority over the lock button. | 491 // Test that the power button takes priority over the lock button. |
| 489 TEST_F(PowerButtonControllerTest, PowerButtonPreemptsLockButton) { | 492 TEST_F(PowerButtonControllerTest, PowerButtonPreemptsLockButton) { |
| 490 controller_->set_has_legacy_power_button_for_test(false); | 493 controller_->set_has_legacy_power_button_for_test(false); |
| 491 state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); | 494 state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); |
| 492 state_controller_->OnLockStateChanged(false); | 495 state_controller_->OnLockStateChanged(false); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 564 |
| 562 EXPECT_EQ(0, NumShutdownRequests()); | 565 EXPECT_EQ(0, NumShutdownRequests()); |
| 563 EXPECT_TRUE(test_api_->real_shutdown_timer_is_running()); | 566 EXPECT_TRUE(test_api_->real_shutdown_timer_is_running()); |
| 564 test_api_->trigger_real_shutdown_timeout(); | 567 test_api_->trigger_real_shutdown_timeout(); |
| 565 EXPECT_EQ(1, NumShutdownRequests()); | 568 EXPECT_EQ(1, NumShutdownRequests()); |
| 566 } | 569 } |
| 567 | 570 |
| 568 TEST_F(PowerButtonControllerTest, RequestShutdownFromLockScreen) { | 571 TEST_F(PowerButtonControllerTest, RequestShutdownFromLockScreen) { |
| 569 state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); | 572 state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); |
| 570 state_controller_->OnLockStateChanged(true); | 573 state_controller_->OnLockStateChanged(true); |
| 571 shell_delegate_->LockScreen(); | 574 state_delegate_->LockScreen(); |
| 572 state_controller_->RequestShutdown(); | 575 state_controller_->RequestShutdown(); |
| 573 EXPECT_TRUE( | 576 EXPECT_TRUE( |
| 574 animator_api_->ContainersAreAnimated( | 577 animator_api_->ContainersAreAnimated( |
| 575 internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, | 578 internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, |
| 576 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY)); | 579 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY)); |
| 577 EXPECT_TRUE( | 580 EXPECT_TRUE( |
| 578 animator_api_->ContainersAreAnimated( | 581 animator_api_->ContainersAreAnimated( |
| 579 internal::SessionStateAnimator::kAllLockScreenContainersMask, | 582 internal::SessionStateAnimator::kAllLockScreenContainersMask, |
| 580 internal::SessionStateAnimator::ANIMATION_FULL_CLOSE)); | 583 internal::SessionStateAnimator::ANIMATION_FULL_CLOSE)); |
| 581 GenerateMouseMoveEvent(); | 584 GenerateMouseMoveEvent(); |
| 582 EXPECT_FALSE(cursor_visible()); | 585 EXPECT_FALSE(cursor_visible()); |
| 583 | 586 |
| 584 EXPECT_EQ(0, NumShutdownRequests()); | 587 EXPECT_EQ(0, NumShutdownRequests()); |
| 585 EXPECT_TRUE(test_api_->real_shutdown_timer_is_running()); | 588 EXPECT_TRUE(test_api_->real_shutdown_timer_is_running()); |
| 586 test_api_->trigger_real_shutdown_timeout(); | 589 test_api_->trigger_real_shutdown_timeout(); |
| 587 EXPECT_EQ(1, NumShutdownRequests()); | 590 EXPECT_EQ(1, NumShutdownRequests()); |
| 588 } | 591 } |
| 589 | 592 |
| 590 TEST_F(PowerButtonControllerTest, RequestAndCancelShutdownFromLockScreen) { | 593 TEST_F(PowerButtonControllerTest, RequestAndCancelShutdownFromLockScreen) { |
| 591 state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); | 594 state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); |
| 592 state_controller_->OnLockStateChanged(true); | 595 state_controller_->OnLockStateChanged(true); |
| 593 shell_delegate_->LockScreen(); | 596 state_delegate_->LockScreen(); |
| 594 | 597 |
| 595 // Press the power button and check that we start the shutdown timer. | 598 // Press the power button and check that we start the shutdown timer. |
| 596 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); | 599 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
| 597 EXPECT_FALSE(test_api_->lock_timer_is_running()); | 600 EXPECT_FALSE(test_api_->lock_timer_is_running()); |
| 598 EXPECT_TRUE(test_api_->shutdown_timer_is_running()); | 601 EXPECT_TRUE(test_api_->shutdown_timer_is_running()); |
| 599 EXPECT_TRUE( | 602 EXPECT_TRUE( |
| 600 animator_api_->ContainersAreAnimated( | 603 animator_api_->ContainersAreAnimated( |
| 601 internal::SessionStateAnimator::kAllContainersMask, | 604 internal::SessionStateAnimator::kAllContainersMask, |
| 602 internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE)); | 605 internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE)); |
| 603 | 606 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 626 | 629 |
| 627 // After increasing the brightness to 10%, we should start the timer like | 630 // After increasing the brightness to 10%, we should start the timer like |
| 628 // usual. | 631 // usual. |
| 629 controller_->OnScreenBrightnessChanged(10.0); | 632 controller_->OnScreenBrightnessChanged(10.0); |
| 630 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); | 633 controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
| 631 EXPECT_TRUE(test_api_->lock_timer_is_running()); | 634 EXPECT_TRUE(test_api_->lock_timer_is_running()); |
| 632 } | 635 } |
| 633 | 636 |
| 634 } // namespace test | 637 } // namespace test |
| 635 } // namespace ash | 638 } // namespace ash |
| OLD | NEW |