| 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 "ui/wm/core/window_animations.h" | 5 #include "ui/wm/core/window_animations.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "ui/aura/client/animation_host.h" | 8 #include "ui/aura/client/animation_host.h" |
| 9 #include "ui/aura/test/aura_test_base.h" | 9 #include "ui/aura/test/aura_test_base.h" |
| 10 #include "ui/aura/test/test_windows.h" | 10 #include "ui/aura/test/test_windows.h" |
| 11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
| 12 #include "ui/compositor/layer.h" | 12 #include "ui/compositor/layer.h" |
| 13 #include "ui/compositor/layer_animator.h" | 13 #include "ui/compositor/layer_animator.h" |
| 14 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 14 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 15 #include "ui/gfx/animation/animation_container_element.h" | 15 #include "ui/gfx/animation/animation_container_element.h" |
| 16 #include "ui/gfx/vector2d.h" | 16 #include "ui/gfx/vector2d.h" |
| 17 | 17 |
| 18 using aura::Window; | 18 using aura::Window; |
| 19 using ui::Layer; | 19 using ui::Layer; |
| 20 | 20 |
| 21 namespace views { | 21 namespace wm { |
| 22 namespace corewm { | |
| 23 | 22 |
| 24 class WindowAnimationsTest : public aura::test::AuraTestBase { | 23 class WindowAnimationsTest : public aura::test::AuraTestBase { |
| 25 public: | 24 public: |
| 26 WindowAnimationsTest() {} | 25 WindowAnimationsTest() {} |
| 27 | 26 |
| 28 virtual void TearDown() OVERRIDE { | 27 virtual void TearDown() OVERRIDE { |
| 29 AuraTestBase::TearDown(); | 28 AuraTestBase::TearDown(); |
| 30 } | 29 } |
| 31 | 30 |
| 32 private: | 31 private: |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 private: | 121 private: |
| 123 bool hide_completed_; | 122 bool hide_completed_; |
| 124 | 123 |
| 125 DISALLOW_COPY_AND_ASSIGN(NotifyHideCompletedAnimationHost); | 124 DISALLOW_COPY_AND_ASSIGN(NotifyHideCompletedAnimationHost); |
| 126 }; | 125 }; |
| 127 | 126 |
| 128 TEST_F(WindowAnimationsTest, NotifyHideCompleted) { | 127 TEST_F(WindowAnimationsTest, NotifyHideCompleted) { |
| 129 NotifyHideCompletedAnimationHost animation_host; | 128 NotifyHideCompletedAnimationHost animation_host; |
| 130 scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithId(0, NULL)); | 129 scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithId(0, NULL)); |
| 131 aura::client::SetAnimationHost(window.get(), &animation_host); | 130 aura::client::SetAnimationHost(window.get(), &animation_host); |
| 132 views::corewm::SetWindowVisibilityAnimationType( | 131 wm::SetWindowVisibilityAnimationType( |
| 133 window.get(), WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); | 132 window.get(), WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); |
| 134 AnimateOnChildWindowVisibilityChanged(window.get(), true); | 133 AnimateOnChildWindowVisibilityChanged(window.get(), true); |
| 135 EXPECT_TRUE(window->layer()->visible()); | 134 EXPECT_TRUE(window->layer()->visible()); |
| 136 | 135 |
| 137 EXPECT_FALSE(animation_host.hide_completed()); | 136 EXPECT_FALSE(animation_host.hide_completed()); |
| 138 AnimateOnChildWindowVisibilityChanged(window.get(), false); | 137 AnimateOnChildWindowVisibilityChanged(window.get(), false); |
| 139 EXPECT_TRUE(animation_host.hide_completed()); | 138 EXPECT_TRUE(animation_host.hide_completed()); |
| 140 } | 139 } |
| 141 | 140 |
| 142 } // namespace corewm | 141 } // namespace wm |
| 143 } // namespace views | |
| OLD | NEW |