| 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 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2178 | 2178 |
| 2179 EXPECT_FALSE(animator->is_animating()); | 2179 EXPECT_FALSE(animator->is_animating()); |
| 2180 EXPECT_EQ(ColorToString(target_color), | 2180 EXPECT_EQ(ColorToString(target_color), |
| 2181 ColorToString(delegate.GetColorForAnimation())); | 2181 ColorToString(delegate.GetColorForAnimation())); |
| 2182 } | 2182 } |
| 2183 | 2183 |
| 2184 // Verifies SchedulePauseForProperties(). | 2184 // Verifies SchedulePauseForProperties(). |
| 2185 TEST(LayerAnimatorTest, SchedulePauseForProperties) { | 2185 TEST(LayerAnimatorTest, SchedulePauseForProperties) { |
| 2186 scoped_refptr<LayerAnimator> animator(LayerAnimator::CreateDefaultAnimator()); | 2186 scoped_refptr<LayerAnimator> animator(LayerAnimator::CreateDefaultAnimator()); |
| 2187 animator->set_preemption_strategy(LayerAnimator::ENQUEUE_NEW_ANIMATION); | 2187 animator->set_preemption_strategy(LayerAnimator::ENQUEUE_NEW_ANIMATION); |
| 2188 animator->SchedulePauseForProperties(base::TimeDelta::FromMilliseconds(100), | 2188 animator->SchedulePauseForProperties( |
| 2189 LayerAnimationElement::TRANSFORM, | 2189 base::TimeDelta::FromMilliseconds(100), |
| 2190 LayerAnimationElement::BOUNDS, -1); | 2190 LayerAnimationElement::TRANSFORM | LayerAnimationElement::BOUNDS); |
| 2191 EXPECT_TRUE(animator->IsAnimatingProperty(LayerAnimationElement::TRANSFORM)); | 2191 EXPECT_TRUE(animator->IsAnimatingProperty(LayerAnimationElement::TRANSFORM)); |
| 2192 EXPECT_TRUE(animator->IsAnimatingProperty(LayerAnimationElement::BOUNDS)); | 2192 EXPECT_TRUE(animator->IsAnimatingProperty(LayerAnimationElement::BOUNDS)); |
| 2193 EXPECT_FALSE(animator->IsAnimatingProperty(LayerAnimationElement::OPACITY)); | 2193 EXPECT_FALSE(animator->IsAnimatingProperty(LayerAnimationElement::OPACITY)); |
| 2194 } | 2194 } |
| 2195 | 2195 |
| 2196 | 2196 |
| 2197 class AnimatorOwner { | 2197 class AnimatorOwner { |
| 2198 public: | 2198 public: |
| 2199 AnimatorOwner() | 2199 AnimatorOwner() |
| 2200 : animator_(LayerAnimator::CreateDefaultAnimator()) { | 2200 : animator_(LayerAnimator::CreateDefaultAnimator()) { |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2464 | 2464 |
| 2465 parent.SetTransform(parent_end); | 2465 parent.SetTransform(parent_end); |
| 2466 | 2466 |
| 2467 EXPECT_TRUE(child.GetAnimator()->is_animating()); | 2467 EXPECT_TRUE(child.GetAnimator()->is_animating()); |
| 2468 EXPECT_TRUE(child.GetTargetTransform().IsIdentity()) | 2468 EXPECT_TRUE(child.GetTargetTransform().IsIdentity()) |
| 2469 << child.GetTargetTransform().ToString(); | 2469 << child.GetTargetTransform().ToString(); |
| 2470 | 2470 |
| 2471 } | 2471 } |
| 2472 | 2472 |
| 2473 } // namespace ui | 2473 } // namespace ui |
| OLD | NEW |