summaryrefslogtreecommitdiffstats
path: root/cc/test
diff options
context:
space:
mode:
authorbrianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-30 01:10:01 +0000
committerbrianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-30 01:10:01 +0000
commitd9fce6725ec0812d04c4015e5b2d1c9e539afe1b (patch)
tree51668ab9ddb0a93e69f575dd8121dc2b5e49af27 /cc/test
parentb24e5c700303a9931006f396c582102eb770ee80 (diff)
downloadchromium_src-d9fce6725ec0812d04c4015e5b2d1c9e539afe1b.zip
chromium_src-d9fce6725ec0812d04c4015e5b2d1c9e539afe1b.tar.gz
chromium_src-d9fce6725ec0812d04c4015e5b2d1c9e539afe1b.tar.bz2
cc: Avoid updating animations in the background without an active tree
This patch prevents LTHI from background ticking animations if there is no active tree to animate since animating with no active tree will often result in segfaults. BUG=280706 Review URL: https://chromiumcodereview.appspot.com/23593003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r--cc/test/layer_tree_test.cc6
-rw-r--r--cc/test/layer_tree_test.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 4933e00..9afe3c4 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -37,6 +37,10 @@ bool TestHooks::PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
return true;
}
+base::TimeDelta TestHooks::LowFrequencyAnimationInterval() const {
+ return base::TimeDelta::FromMilliseconds(16);
+}
+
// Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks.
class LayerTreeHostImplForTesting : public LayerTreeHostImpl {
public:
@@ -169,7 +173,7 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl {
}
virtual base::TimeDelta LowFrequencyAnimationInterval() const OVERRIDE {
- return base::TimeDelta::FromMilliseconds(16);
+ return test_hooks_->LowFrequencyAnimationInterval();
}
private:
diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h
index 885323b..c6a3f4d 100644
--- a/cc/test/layer_tree_test.h
+++ b/cc/test/layer_tree_test.h
@@ -68,6 +68,7 @@ class TestHooks : public AnimationDelegate {
virtual void DidDeferCommit() {}
virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
bool visible) {}
+ virtual base::TimeDelta LowFrequencyAnimationInterval() const;
// Implementation of AnimationDelegate:
virtual void NotifyAnimationStarted(double time) OVERRIDE {}