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/compositor/layer_animator.h" | 5 #include "ui/compositor/layer_animator.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 1982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 | 1993 |
1994 // Completing the animation should have stopped the bounds | 1994 // Completing the animation should have stopped the bounds |
1995 // animation. | 1995 // animation. |
1996 ASSERT_FALSE(animator->IsAnimatingProperty(LayerAnimationElement::BOUNDS)); | 1996 ASSERT_FALSE(animator->IsAnimatingProperty(LayerAnimationElement::BOUNDS)); |
1997 } | 1997 } |
1998 | 1998 |
1999 // Similar to the ObserverDeletesAnimationsOnEnd test above except that it | 1999 // Similar to the ObserverDeletesAnimationsOnEnd test above except that it |
2000 // tests the behavior when the OnLayerAnimationAborted() callback causes | 2000 // tests the behavior when the OnLayerAnimationAborted() callback causes |
2001 // all of the animator's other animations to be deleted. | 2001 // all of the animator's other animations to be deleted. |
2002 TEST(LayerAnimatorTest, ObserverDeletesAnimationsOnAbort) { | 2002 TEST(LayerAnimatorTest, ObserverDeletesAnimationsOnAbort) { |
2003 ScopedAnimationDurationScaleMode normal_duration_mode( | 2003 ScopedAnimationDurationScaleMode test_duration_mode( |
2004 ScopedAnimationDurationScaleMode::NORMAL_DURATION); | 2004 ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); |
2005 scoped_refptr<LayerAnimator> animator(new TestLayerAnimator()); | 2005 scoped_refptr<LayerAnimator> animator(new TestLayerAnimator()); |
2006 animator->set_disable_timer_for_test(true); | 2006 animator->set_disable_timer_for_test(true); |
2007 TestLayerAnimationDelegate delegate; | 2007 TestLayerAnimationDelegate delegate; |
2008 animator->SetDelegate(&delegate); | 2008 animator->SetDelegate(&delegate); |
2009 | 2009 |
2010 double start_brightness(0.0); | 2010 double start_brightness(0.0); |
2011 double target_brightness(1.0); | 2011 double target_brightness(1.0); |
2012 gfx::Rect start_bounds(0, 0, 50, 50); | 2012 gfx::Rect start_bounds(0, 0, 50, 50); |
2013 gfx::Rect target_bounds(5, 5, 5, 5); | 2013 gfx::Rect target_bounds(5, 5, 5, 5); |
2014 base::TimeDelta brightness_delta = base::TimeDelta::FromSeconds(1); | 2014 base::TimeDelta brightness_delta = base::TimeDelta::FromSeconds(1); |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2614 | 2614 |
2615 root_2.Add(&layer); | 2615 root_2.Add(&layer); |
2616 EXPECT_FALSE(compositor_1->layer_animator_collection()->HasActiveAnimators()); | 2616 EXPECT_FALSE(compositor_1->layer_animator_collection()->HasActiveAnimators()); |
2617 EXPECT_TRUE(compositor_2->layer_animator_collection()->HasActiveAnimators()); | 2617 EXPECT_TRUE(compositor_2->layer_animator_collection()->HasActiveAnimators()); |
2618 host_2.reset(); | 2618 host_2.reset(); |
2619 host_1.reset(); | 2619 host_1.reset(); |
2620 TerminateContextFactoryForTests(); | 2620 TerminateContextFactoryForTests(); |
2621 } | 2621 } |
2622 | 2622 |
2623 } // namespace ui | 2623 } // namespace ui |
OLD | NEW |