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

Side by Side Diff: ui/compositor/layer_animator_unittest.cc

Issue 134453004: Use a bitfield to store animatable properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another win build error (signed/unsigned comp). Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/compositor/layer_animator.cc ('k') | ui/compositor/scoped_layer_animation_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/compositor/layer_animator.cc ('k') | ui/compositor/scoped_layer_animation_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698