summaryrefslogtreecommitdiffstats
path: root/ash/wm/session_state_controller_impl2_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ash/wm/session_state_controller_impl2_unittest.cc')
-rw-r--r--ash/wm/session_state_controller_impl2_unittest.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/ash/wm/session_state_controller_impl2_unittest.cc b/ash/wm/session_state_controller_impl2_unittest.cc
index ec2f998..08032e6 100644
--- a/ash/wm/session_state_controller_impl2_unittest.cc
+++ b/ash/wm/session_state_controller_impl2_unittest.cc
@@ -19,6 +19,7 @@
#include "ui/aura/root_window.h"
#include "ui/aura/test/event_generator.h"
#include "ui/compositor/layer_animator.h"
+#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/compositor/test/compositor_test_support.h"
#include "ui/gfx/rect.h"
@@ -112,13 +113,15 @@ class SessionStateControllerImpl2Test : public AshTestBase {
AshTestBase::SetUp();
// We would control animations in a fine way:
- ui::LayerAnimator::set_disable_animations_for_test(false);
+ animation_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode(
+ ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION));
// TODO(antrim) : restore
// animator_helper_ = ui::test::CreateLayerAnimatorHelperForTest();
// Temporary disable animations so that observer is always called, and
// no leaks happen during tests.
- ui::LayerAnimator::set_disable_animations_for_test(true);
+ animation_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode(
+ ui::ScopedAnimationDurationScaleMode::ZERO_DURATION));
// TODO(antrim): once there is a way to mock time and run animations, make
// sure that animations are finished even in simple tests.
@@ -397,6 +400,7 @@ class SessionStateControllerImpl2Test : public AshTestBase {
TestSessionStateControllerDelegate* delegate_; // not owned
TestShellDelegate* shell_delegate_; // not owned
+ scoped_ptr<ui::ScopedAnimationDurationScaleMode> animation_duration_mode_;
scoped_ptr<SessionStateControllerImpl2::TestApi> test_api_;
scoped_ptr<SessionStateAnimator::TestApi> animator_api_;
// TODO(antrim) : restore
@@ -719,7 +723,8 @@ TEST_F(SessionStateControllerImpl2Test, CancelLockToShutdown) {
// TODO(antrim): Reenable this: http://crbug.com/167048
TEST_F(SessionStateControllerImpl2Test, DISABLED_Lock) {
// We require animations to have a duration for this test.
- ui::LayerAnimator::set_disable_animations_for_test(false);
+ ui::ScopedAnimationDurationScaleMode normal_duration_mode(
+ ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
Initialize(false, user::LOGGED_IN_USER);