Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2494)

Unified Diff: ash/wm/window_animations_unittest.cc

Issue 10882043: Revert 153291 - Fixes crash introduced @ 153047 (you can hit crash by maximizing a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_animations.cc ('k') | ui/compositor/layer_animation_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ash/wm/window_animations.cc ('k') | ui/compositor/layer_animation_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698