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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 2158973002: cc: Clean up LayerTreeTest and TestHooks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: proxy-impls: test Created 4 years, 5 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_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_animation.cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index c0f63099fcc16ae4c3dddc5939910542fdab4a80..62acaf7088a0107ddd1bbaeac496012daebd0304 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -1178,7 +1178,7 @@ class LayerTreeHostAnimationTestPendingTreeAnimatesFirstCommit
PostSetNeedsCommitToMainThread();
}
- void WillPrepareTiles(LayerTreeHostImpl* host_impl) override {
+ void WillPrepareTilesOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->sync_tree()->source_frame_number() != 0)
return;
@@ -1344,12 +1344,14 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating
if (host_impl->active_tree()->source_frame_number() < 2)
return;
- // Animation state is updated after drawing.
- ImplThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&LayerTreeHostAnimationTestAddAnimationAfterAnimating::
- CheckAnimations,
- base::Unretained(this), host_impl));
+ // Animation state is updated after drawing. Only do this once.
+ if (!TestEnded()) {
+ ImplThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&LayerTreeHostAnimationTestAddAnimationAfterAnimating::
+ CheckAnimations,
+ base::Unretained(this), host_impl));
+ }
}
void CheckAnimations(LayerTreeHostImpl* host_impl) {
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698