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

Unified Diff: ui/compositor/layer_animation_sequence_unittest.cc

Issue 134453004: Use a bitfield to store animatable properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build error 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 side-by-side diff with in-line comments
Download patch
Index: ui/compositor/layer_animation_sequence_unittest.cc
diff --git a/ui/compositor/layer_animation_sequence_unittest.cc b/ui/compositor/layer_animation_sequence_unittest.cc
index 3b4591762b09b5be4acf8001fa31a6b8156c40af..1396bdf57db787fe1a9ddb0c835342ce234c00ee 100644
--- a/ui/compositor/layer_animation_sequence_unittest.cc
+++ b/ui/compositor/layer_animation_sequence_unittest.cc
@@ -28,9 +28,8 @@ TEST(LayerAnimationSequenceTest, NoElement) {
start_time += base::TimeDelta::FromSeconds(1);
sequence.set_start_time(start_time);
EXPECT_TRUE(sequence.IsFinished(start_time));
- EXPECT_TRUE(sequence.properties().size() == 0);
- LayerAnimationElement::AnimatableProperties properties;
- EXPECT_FALSE(sequence.HasConflictingProperty(properties));
+ EXPECT_TRUE(sequence.properties() == LayerAnimationElement::UNKNOWN);
sky 2014/01/13 14:26:42 EXPECT_EQ (here and similar places in this file).
Ian Vollick 2014/01/13 19:03:59 Done.
+ EXPECT_FALSE(sequence.HasConflictingProperty(LayerAnimationElement::UNKNOWN));
}
// Check that the sequences progresses the delegate as expected when it contains
@@ -62,9 +61,7 @@ TEST(LayerAnimationSequenceTest, SingleElement) {
EXPECT_FLOAT_EQ(target, delegate.GetBrightnessForAnimation());
}
- EXPECT_TRUE(sequence.properties().size() == 1);
- EXPECT_TRUE(sequence.properties().find(LayerAnimationElement::BRIGHTNESS) !=
- sequence.properties().end());
+ EXPECT_TRUE(sequence.properties() == LayerAnimationElement::BRIGHTNESS);
}
// Check that the sequences progresses the delegate as expected when it contains
@@ -105,9 +102,7 @@ TEST(LayerAnimationSequenceTest, SingleThreadedElement) {
EXPECT_FLOAT_EQ(target, delegate.GetOpacityForAnimation());
}
- EXPECT_TRUE(sequence.properties().size() == 1);
- EXPECT_TRUE(sequence.properties().find(LayerAnimationElement::OPACITY) !=
- sequence.properties().end());
+ EXPECT_TRUE(sequence.properties() == LayerAnimationElement::OPACITY);
}
// Check that the sequences progresses the delegate as expected when it contains
@@ -125,11 +120,8 @@ TEST(LayerAnimationSequenceTest, MultipleElement) {
LayerAnimationElement::CreateOpacityElement(target_opacity, delta));
// Pause bounds for a second.
- LayerAnimationElement::AnimatableProperties properties;
- properties.insert(LayerAnimationElement::BOUNDS);
-
- sequence.AddElement(
- LayerAnimationElement::CreatePauseElement(properties, delta));
+ sequence.AddElement(LayerAnimationElement::CreatePauseElement(
+ LayerAnimationElement::BOUNDS, delta));
gfx::Transform start_transform, target_transform, middle_transform;
start_transform.Rotate(-30.0);
@@ -196,13 +188,9 @@ TEST(LayerAnimationSequenceTest, MultipleElement) {
delegate.GetTransformForAnimation());
}
- EXPECT_TRUE(sequence.properties().size() == 3);
- EXPECT_TRUE(sequence.properties().find(LayerAnimationElement::OPACITY) !=
- sequence.properties().end());
- EXPECT_TRUE(sequence.properties().find(LayerAnimationElement::TRANSFORM) !=
- sequence.properties().end());
- EXPECT_TRUE(sequence.properties().find(LayerAnimationElement::BOUNDS) !=
- sequence.properties().end());
+ EXPECT_TRUE(sequence.properties() == (LayerAnimationElement::OPACITY |
+ LayerAnimationElement::TRANSFORM |
+ LayerAnimationElement::BOUNDS));
}
// Check that a sequence can still be aborted if it has cycled many times.

Powered by Google App Engine
This is Rietveld 408576698