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

Unified Diff: ui/gfx/compositor/layer_animator_unittest.cc

Issue 9817026: Changes how we detect whether the launcher should be shown when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 8 years, 9 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
« no previous file with comments | « ui/gfx/compositor/layer_animator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer_animator_unittest.cc
diff --git a/ui/gfx/compositor/layer_animator_unittest.cc b/ui/gfx/compositor/layer_animator_unittest.cc
index 271120ac6ae35bb0e9055e51a5c70a18852f41da..d2c0bafb958d193af62c9449fd720029a576a29a 100644
--- a/ui/gfx/compositor/layer_animator_unittest.cc
+++ b/ui/gfx/compositor/layer_animator_unittest.cc
@@ -1010,4 +1010,25 @@ TEST(LayerAnimatorTest, ImmediatelySettingNewTargetDoesNotLeak) {
CheckApproximatelyEqual(delegate.GetBoundsForAnimation(), target_bounds);
}
+// Verifies GetTargetOpacity() works when multiple sequences are scheduled.
+TEST(LayerAnimatorTest, GetTargetOpacity) {
+ scoped_ptr<LayerAnimator> animator(LayerAnimator::CreateDefaultAnimator());
+ animator->set_preemption_strategy(LayerAnimator::ENQUEUE_NEW_ANIMATION);
+ animator->set_disable_timer_for_test(true);
+ TestLayerAnimationDelegate delegate;
+ animator->SetDelegate(&delegate);
+
+ delegate.SetOpacityFromAnimation(0.0);
+
+ {
+ ScopedLayerAnimationSettings settings(animator.get());
+ animator->SetOpacity(0.5);
+ EXPECT_EQ(0.5, animator->GetTargetOpacity());
+
+ // Because the strategy is ENQUEUE_NEW_ANIMATION the target should now be 1.
+ animator->SetOpacity(1.0);
+ EXPECT_EQ(1.0, animator->GetTargetOpacity());
+ }
+}
+
} // namespace ui
« no previous file with comments | « ui/gfx/compositor/layer_animator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698