diff options
author | nduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-02 22:28:30 +0000 |
---|---|---|
committer | nduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-02 22:28:30 +0000 |
commit | 0cbb85c6a7ecf0e6c406e3d7762e8d16eb336e42 (patch) | |
tree | 6fdcdb6156bc714882064a3ad8bc87095c337e23 /cc/trees/layer_tree_host_unittest_animation.cc | |
parent | 0d0f782679c24384e3daf98af7b717862e65b65e (diff) | |
download | chromium_src-0cbb85c6a7ecf0e6c406e3d7762e8d16eb336e42.zip chromium_src-0cbb85c6a7ecf0e6c406e3d7762e8d16eb336e42.tar.gz chromium_src-0cbb85c6a7ecf0e6c406e3d7762e8d16eb336e42.tar.bz2 |
Revert 253910 "Make it possible to cancel commits following an a..."
This caused rasterize_and_record_micro to fail on mac and windows perf
bots, e.g:
http://build.chromium.org/p/chromium.perf/builders/Mac%2010.8%20Perf%20%285%29/builds/3556
> Make it possible to cancel commits following an animation
>
> If we didn't invalidate anything when running main thread animations, there is
> no need to continue with the commit.
>
> BUG=345584,347255
>
> Review URL: https://codereview.chromium.org/178123003
BUG=348433
TBR=skyostil@chromium.org
Review URL: https://codereview.chromium.org/185383003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees/layer_tree_host_unittest_animation.cc')
-rw-r--r-- | cc/trees/layer_tree_host_unittest_animation.cc | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index 3ef6bbb..165d30b 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -783,15 +783,6 @@ class LayerTreeHostAnimationTestContinuousAnimate num_draw_layers_(0) { } - virtual void SetupTree() OVERRIDE { - LayerTreeHostAnimationTest::SetupTree(); - // Create a fake content layer so we actually produce new content for every - // animation frame. - content_ = FakeContentLayer::Create(&client_); - content_->set_always_update_resources(true); - layer_tree_host()->root_layer()->AddChild(content_); - } - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } @@ -825,82 +816,10 @@ class LayerTreeHostAnimationTestContinuousAnimate private: int num_commit_complete_; int num_draw_layers_; - FakeContentLayerClient client_; - scoped_refptr<FakeContentLayer> content_; }; MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestContinuousAnimate); -class LayerTreeHostAnimationTestCancelAnimateCommit - : public LayerTreeHostAnimationTest { - public: - LayerTreeHostAnimationTestCancelAnimateCommit() : num_animate_calls_(0) {} - - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } - - virtual void Animate(base::TimeTicks) OVERRIDE { - // No-op animate will cancel the commit. - if (++num_animate_calls_ == 2) { - EndTest(); - return; - } - layer_tree_host()->SetNeedsAnimate(); - } - - virtual void CommitCompleteOnThread(LayerTreeHostImpl* tree_impl) OVERRIDE { - FAIL() << "Commit should have been canceled."; - } - - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { - FAIL() << "Draw should have been canceled."; - } - - virtual void AfterTest() OVERRIDE { EXPECT_EQ(2, num_animate_calls_); } - - private: - int num_animate_calls_; - FakeContentLayerClient client_; - scoped_refptr<FakeContentLayer> content_; -}; - -MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestCancelAnimateCommit); - -class LayerTreeHostAnimationTestForceRedraw - : public LayerTreeHostAnimationTest { - public: - LayerTreeHostAnimationTestForceRedraw() - : num_animate_(0), num_draw_layers_(0) {} - - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } - - virtual void Animate(base::TimeTicks) OVERRIDE { - if (++num_animate_ < 2) - layer_tree_host()->SetNeedsAnimate(); - } - - virtual void Layout() OVERRIDE { - layer_tree_host()->SetNextCommitForcesRedraw(); - } - - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { - if (++num_draw_layers_ == 2) - EndTest(); - } - - virtual void AfterTest() OVERRIDE { - // The first commit will always draw; make sure the second draw triggered - // by the animation was not cancelled. - EXPECT_EQ(2, num_draw_layers_); - EXPECT_EQ(2, num_animate_); - } - - private: - int num_animate_; - int num_draw_layers_; -}; - -MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestForceRedraw); - // Make sure the main thread can still execute animations when CanDraw() is not // true. class LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw |