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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: else if typo Created 7 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
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 fa4b88632b366eb61b42e1ec4be1cec63d25e3c9..e6677c911b892b772f8211f9ef1a63909f284dde 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -264,18 +264,18 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded
PostAddAnimationToMainThread(layer_tree_host()->root_layer());
}
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ if (num_animates_ == 1)
+ PostSetVisibleToMainThread(false);
+ }
+
// Use WillAnimateLayers to set visible false before the animation runs and
// causes a commit, so we block the second visible animate in single-thread
// mode.
virtual void WillAnimateLayers(
LayerTreeHostImpl* host_impl,
base::TimeTicks monotonic_time) OVERRIDE {
- if (num_animates_ < 2) {
- if (!num_animates_) {
- // We have a long animation running. It should continue to tick even
- // if we are not visible.
- PostSetVisibleToMainThread(false);
- }
+ if (num_animates_ < 3) {
num_animates_++;
return;
}
@@ -311,6 +311,8 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction
virtual void AnimateLayers(
LayerTreeHostImpl* host_impl,
base::TimeTicks monotonic_time) OVERRIDE {
+ if (!host_impl->active_tree()->root_layer())
+ return;
LayerAnimationController* controller_impl =
host_impl->active_tree()->root_layer()->children()[0]->
layer_animation_controller();
@@ -380,6 +382,9 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
virtual void UpdateAnimationState(
LayerTreeHostImpl* impl_host,
bool has_unfinished_animation) OVERRIDE {
+ if (!impl_host->active_tree()->root_layer())
+ return;
+
LayerAnimationController* controller =
impl_host->active_tree()->root_layer()->children()[0]->
layer_animation_controller();

Powered by Google App Engine
This is Rietveld 408576698