Index: ash/wm/window_animations_unittest.cc |
=================================================================== |
--- ash/wm/window_animations_unittest.cc (revision 153309) |
+++ ash/wm/window_animations_unittest.cc (working copy) |
@@ -19,19 +19,8 @@ |
namespace ash { |
namespace internal { |
-class WindowAnimationsTest : public ash::test::AshTestBase { |
- public: |
- WindowAnimationsTest() {} |
+typedef ash::test::AshTestBase WindowAnimationsTest; |
- virtual void TearDown() OVERRIDE { |
- ui::LayerAnimator::set_disable_animations_for_test(true); |
- AshTestBase::TearDown(); |
- } |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(WindowAnimationsTest); |
-}; |
- |
TEST_F(WindowAnimationsTest, HideShow) { |
scoped_ptr<aura::Window> window( |
aura::test::CreateTestWindowWithId(0, NULL)); |
@@ -151,7 +140,7 @@ |
} |
TEST_F(WindowAnimationsTest, CrossFadeToBounds) { |
- ui::LayerAnimator::set_disable_animations_for_test(false); |
+ internal::SetDelayedOldLayerDeletionInCrossFadeForTest(true); |
scoped_ptr<Window> window( |
aura::test::CreateTestWindowWithId(0, NULL)); |
@@ -176,9 +165,8 @@ |
EXPECT_EQ(1.0f, window->layer()->GetTargetOpacity()); |
EXPECT_EQ(ui::Transform(), window->layer()->GetTargetTransform()); |
- // Run the animations to completion. |
- old_layer->GetAnimator()->StopAnimating(); |
- window->layer()->GetAnimator()->StopAnimating(); |
+ // Allow the animation observer to delete itself. |
+ RunAllPendingInMessageLoop(); |
// Cross fade to a smaller size, as in a restore animation. |
old_layer = window->layer(); |
@@ -196,8 +184,8 @@ |
EXPECT_EQ(1.0f, window->layer()->GetTargetOpacity()); |
EXPECT_EQ(ui::Transform(), window->layer()->GetTargetTransform()); |
- old_layer->GetAnimator()->StopAnimating(); |
- window->layer()->GetAnimator()->StopAnimating(); |
+ RunAllPendingInMessageLoop(); |
+ internal::SetDelayedOldLayerDeletionInCrossFadeForTest(false); |
} |
TEST_F(WindowAnimationsTest, GetCrossFadeDuration) { |