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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 650353003: Don't clobber active page scale animation with null pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 79abc1c02f2ef28116296a3c79f43ce0a1a998c2..34fabbaaf8374bd121b368c23fb3144cba73bb7e 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -1289,6 +1289,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) {
base::TimeTicks start_time = base::TimeTicks() +
base::TimeDelta::FromSeconds(1);
base::TimeDelta duration = base::TimeDelta::FromMilliseconds(100);
+ base::TimeTicks third_through_animation = start_time + duration / 3;
base::TimeTicks halfway_through_animation = start_time + duration / 2;
base::TimeTicks end_time = start_time + duration;
float target_scale = 2.f;
@@ -1336,6 +1337,15 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) {
did_request_redraw_ = false;
did_request_animate_ = false;
+ host_impl_->Animate(third_through_animation);
+ EXPECT_TRUE(did_request_redraw_);
+ EXPECT_TRUE(did_request_animate_);
+
+ // Another activation shouldn't have any effect on the animation.
+ host_impl_->ActivateSyncTree();
+
+ did_request_redraw_ = false;
+ did_request_animate_ = false;
host_impl_->Animate(halfway_through_animation);
EXPECT_TRUE(did_request_redraw_);
EXPECT_TRUE(did_request_animate_);
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698