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

Side by Side Diff: ui/compositor/layer_animation_element_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_animation_element.cc ('k') | ui/compositor/layer_animation_observer.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_animation_element.h" 5 #include "ui/compositor/layer_animation_element.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/time/time.h" 10 #include "base/time/time.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 307 }
308 308
309 LayerAnimationElement::TargetValue target_value(&delegate); 309 LayerAnimationElement::TargetValue target_value(&delegate);
310 element->GetTargetValue(&target_value); 310 element->GetTargetValue(&target_value);
311 EXPECT_FLOAT_EQ(target, target_value.grayscale); 311 EXPECT_FLOAT_EQ(target, target_value.grayscale);
312 } 312 }
313 313
314 // Check that the pause element progresses the delegate as expected and 314 // Check that the pause element progresses the delegate as expected and
315 // that the element can be reused after it completes. 315 // that the element can be reused after it completes.
316 TEST(LayerAnimationElementTest, PauseElement) { 316 TEST(LayerAnimationElementTest, PauseElement) {
317 LayerAnimationElement::AnimatableProperties properties; 317 LayerAnimationElement::AnimatableProperties properties =
318 properties.insert(LayerAnimationElement::TRANSFORM); 318 LayerAnimationElement::TRANSFORM | LayerAnimationElement::BOUNDS |
319 properties.insert(LayerAnimationElement::BOUNDS); 319 LayerAnimationElement::OPACITY | LayerAnimationElement::BRIGHTNESS |
320 properties.insert(LayerAnimationElement::OPACITY); 320 LayerAnimationElement::GRAYSCALE;
321 properties.insert(LayerAnimationElement::BRIGHTNESS); 321
322 properties.insert(LayerAnimationElement::GRAYSCALE);
323 base::TimeTicks start_time; 322 base::TimeTicks start_time;
324 base::TimeDelta delta = base::TimeDelta::FromSeconds(1); 323 base::TimeDelta delta = base::TimeDelta::FromSeconds(1);
325 324
326 scoped_ptr<LayerAnimationElement> element( 325 scoped_ptr<LayerAnimationElement> element(
327 LayerAnimationElement::CreatePauseElement(properties, delta)); 326 LayerAnimationElement::CreatePauseElement(properties, delta));
328 327
329 TestLayerAnimationDelegate delegate; 328 TestLayerAnimationDelegate delegate;
330 TestLayerAnimationDelegate copy = delegate; 329 TestLayerAnimationDelegate copy = delegate;
331 330
332 start_time += delta; 331 start_time += delta;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 element->Abort(&delegate); 427 element->Abort(&delegate);
429 target_transform.Blend(start_transform, 428 target_transform.Blend(start_transform,
430 gfx::Tween::CalculateValue(tween_type, 0.5)); 429 gfx::Tween::CalculateValue(tween_type, 0.5));
431 CheckApproximatelyEqual(target_transform, 430 CheckApproximatelyEqual(target_transform,
432 delegate.GetTransformForAnimation()); 431 delegate.GetTransformForAnimation());
433 } 432 }
434 433
435 } // namespace 434 } // namespace
436 435
437 } // namespace ui 436 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_animation_element.cc ('k') | ui/compositor/layer_animation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698