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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1296673004: Devtools/CC: Remove continuous repainting feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index fd9d18b9a00dad4d30154369c93abd09b9899de5..588f9e48ce111fb9ee0566eea078daad34b1dec2 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -4529,88 +4529,6 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationForced);
-class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest {
- public:
- LayerTreeHostTestContinuousPainting()
- : num_commits_(0), num_draws_(0), bounds_(20, 20), child_layer_(NULL) {}
-
- protected:
- enum { kExpectedNumCommits = 10 };
-
- void SetupTree() override {
- scoped_refptr<Layer> root_layer = Layer::Create(layer_settings());
- root_layer->SetBounds(bounds_);
-
- child_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
- child_layer_->SetBounds(bounds_);
- child_layer_->SetIsDrawable(true);
- root_layer->AddChild(child_layer_);
-
- layer_tree_host()->SetRootLayer(root_layer);
- layer_tree_host()->SetViewportSize(bounds_);
- LayerTreeHostTest::SetupTree();
- }
-
- void BeginTest() override {
- MainThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(
- &LayerTreeHostTestContinuousPainting::EnableContinuousPainting,
- base::Unretained(this)));
- // Wait 50x longer than expected.
- double milliseconds_per_frame =
- 1000.0 / layer_tree_host()->settings().renderer_settings.refresh_rate;
- MainThreadTaskRunner()->PostDelayedTask(
- FROM_HERE,
- base::Bind(
- &LayerTreeHostTestContinuousPainting::DisableContinuousPainting,
- base::Unretained(this)),
- base::TimeDelta::FromMilliseconds(50 * kExpectedNumCommits *
- milliseconds_per_frame));
- }
-
- void BeginMainFrame(const BeginFrameArgs& args) override {
- child_layer_->SetNeedsDisplay();
- }
-
- void AfterTest() override {
- EXPECT_LE(kExpectedNumCommits, num_commits_);
- EXPECT_LE(kExpectedNumCommits, num_draws_);
- EXPECT_LE(kExpectedNumCommits, child_layer_->update_count());
- }
-
- void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
- if (++num_draws_ == kExpectedNumCommits)
- EndTest();
- }
-
- void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
- ++num_commits_;
- }
-
- private:
- void EnableContinuousPainting() {
- LayerTreeDebugState debug_state = layer_tree_host()->debug_state();
- debug_state.continuous_painting = true;
- layer_tree_host()->SetDebugState(debug_state);
- }
-
- void DisableContinuousPainting() {
- LayerTreeDebugState debug_state = layer_tree_host()->debug_state();
- debug_state.continuous_painting = false;
- layer_tree_host()->SetDebugState(debug_state);
- EndTest();
- }
-
- int num_commits_;
- int num_draws_;
- const gfx::Size bounds_;
- FakeContentLayerClient client_;
- scoped_refptr<FakePictureLayer> child_layer_;
-};
-
-MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting);
-
class LayerTreeHostTestWillBeginImplFrameHasDidFinishImplFrame
: public LayerTreeHostTest {
public:
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698