summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
Diffstat (limited to 'cc/trees')
-rw-r--r--cc/trees/layer_tree_host_common_perftest.cc79
-rw-r--r--cc/trees/layer_tree_host_perftest.cc33
-rw-r--r--cc/trees/layer_tree_host_unittest.cc493
-rw-r--r--cc/trees/layer_tree_host_unittest_animation.cc3
-rw-r--r--cc/trees/layer_tree_host_unittest_context.cc60
-rw-r--r--cc/trees/layer_tree_host_unittest_copyrequest.cc22
-rw-r--r--cc/trees/layer_tree_host_unittest_damage.cc4
-rw-r--r--cc/trees/layer_tree_host_unittest_delegated.cc5
-rw-r--r--cc/trees/layer_tree_host_unittest_picture.cc11
-rw-r--r--cc/trees/layer_tree_host_unittest_proxy.cc16
-rw-r--r--cc/trees/layer_tree_host_unittest_scroll.cc28
11 files changed, 134 insertions, 620 deletions
diff --git a/cc/trees/layer_tree_host_common_perftest.cc b/cc/trees/layer_tree_host_common_perftest.cc
index 9a5de06..08e5404 100644
--- a/cc/trees/layer_tree_host_common_perftest.cc
+++ b/cc/trees/layer_tree_host_common_perftest.cc
@@ -77,48 +77,9 @@ class LayerTreeHostCommonPerfTest : public LayerTreeTest {
std::string json_;
};
-class CalcDrawPropsMainTest : public LayerTreeHostCommonPerfTest {
+class CalcDrawPropsTest : public LayerTreeHostCommonPerfTest {
public:
- void RunCalcDrawProps() { RunTest(false, false, false); }
-
- void BeginTest() override {
- timer_.Reset();
-
- do {
- bool can_render_to_separate_surface = true;
- bool verify_property_trees = false;
- int max_texture_size = 8096;
- RenderSurfaceLayerList update_list;
- PropertyTrees property_trees;
- LayerTreeHostCommon::CalcDrawPropsMainInputs inputs(
- layer_tree_host()->root_layer(),
- layer_tree_host()->device_viewport_size(), gfx::Transform(),
- layer_tree_host()->device_scale_factor(),
- layer_tree_host()->page_scale_factor(),
- layer_tree_host()->overscroll_elasticity_layer(),
- layer_tree_host()->elastic_overscroll(),
- layer_tree_host()->page_scale_layer(), max_texture_size,
- layer_tree_host()->settings().can_use_lcd_text,
- layer_tree_host()->settings().layers_always_allowed_lcd_text,
- can_render_to_separate_surface,
- layer_tree_host()
- ->settings()
- .layer_transforms_should_scale_layer_contents,
- verify_property_trees, &update_list, 0, &property_trees);
- LayerTreeHostCommon::CalculateDrawProperties(&inputs);
-
- timer_.NextLap();
- } while (!timer_.HasTimeLimitExpired());
-
- EndTest();
- }
-};
-
-class CalcDrawPropsImplTest : public LayerTreeHostCommonPerfTest {
- public:
- void RunCalcDrawProps() {
- RunTestWithImplSidePainting();
- }
+ void RunCalcDrawProps() { RunTest(false, false); }
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
@@ -163,10 +124,10 @@ class CalcDrawPropsImplTest : public LayerTreeHostCommonPerfTest {
}
};
-class BspTreePerfTest : public CalcDrawPropsImplTest {
+class BspTreePerfTest : public CalcDrawPropsTest {
public:
BspTreePerfTest() : num_duplicates_(1) {}
- void RunSortLayers() { RunTest(false, false, false); }
+ void RunSortLayers() { RunTest(false, false); }
void SetNumberOfDuplicates(int num_duplicates) {
num_duplicates_ = num_duplicates;
@@ -230,49 +191,25 @@ class BspTreePerfTest : public CalcDrawPropsImplTest {
int num_duplicates_;
};
-TEST_F(CalcDrawPropsMainTest, TenTen) {
- SetTestName("10_10_main_thread");
- ReadTestFile("10_10_layer_tree");
- RunCalcDrawProps();
-}
-
-TEST_F(CalcDrawPropsMainTest, HeavyPage) {
- SetTestName("heavy_page_main_thread");
- ReadTestFile("heavy_layer_tree");
- RunCalcDrawProps();
-}
-
-TEST_F(CalcDrawPropsMainTest, TouchRegionLight) {
- SetTestName("touch_region_light_main_thread");
- ReadTestFile("touch_region_light");
- RunCalcDrawProps();
-}
-
-TEST_F(CalcDrawPropsMainTest, TouchRegionHeavy) {
- SetTestName("touch_region_heavy_main_thread");
- ReadTestFile("touch_region_heavy");
- RunCalcDrawProps();
-}
-
-TEST_F(CalcDrawPropsImplTest, TenTen) {
+TEST_F(CalcDrawPropsTest, TenTen) {
SetTestName("10_10");
ReadTestFile("10_10_layer_tree");
RunCalcDrawProps();
}
-TEST_F(CalcDrawPropsImplTest, HeavyPage) {
+TEST_F(CalcDrawPropsTest, HeavyPage) {
SetTestName("heavy_page");
ReadTestFile("heavy_layer_tree");
RunCalcDrawProps();
}
-TEST_F(CalcDrawPropsImplTest, TouchRegionLight) {
+TEST_F(CalcDrawPropsTest, TouchRegionLight) {
SetTestName("touch_region_light");
ReadTestFile("touch_region_light");
RunCalcDrawProps();
}
-TEST_F(CalcDrawPropsImplTest, TouchRegionHeavy) {
+TEST_F(CalcDrawPropsTest, TouchRegionHeavy) {
SetTestName("touch_region_heavy");
ReadTestFile("touch_region_heavy");
RunCalcDrawProps();
diff --git a/cc/trees/layer_tree_host_perftest.cc b/cc/trees/layer_tree_host_perftest.cc
index 9a9065d..5a17877 100644
--- a/cc/trees/layer_tree_host_perftest.cc
+++ b/cc/trees/layer_tree_host_perftest.cc
@@ -148,13 +148,13 @@ class LayerTreeHostPerfTestJsonReader : public LayerTreeHostPerfTest {
TEST_F(LayerTreeHostPerfTestJsonReader, TenTenSingleThread) {
SetTestName("10_10_single_thread");
ReadTestFile("10_10_layer_tree");
- RunTest(false, false, false);
+ RunTest(false, false);
}
-TEST_F(LayerTreeHostPerfTestJsonReader, TenTenThreadedImplSide) {
+TEST_F(LayerTreeHostPerfTestJsonReader, TenTenThreaded) {
SetTestName("10_10_threaded_impl_side");
ReadTestFile("10_10_layer_tree");
- RunTestWithImplSidePainting();
+ RunTest(true, false);
}
// Simulates a tab switcher scene with two stacks of 10 tabs each.
@@ -163,15 +163,14 @@ TEST_F(LayerTreeHostPerfTestJsonReader,
full_damage_each_frame_ = true;
SetTestName("10_10_single_thread_full_damage_each_frame");
ReadTestFile("10_10_layer_tree");
- RunTest(false, false, false);
+ RunTest(false, false);
}
-TEST_F(LayerTreeHostPerfTestJsonReader,
- TenTenThreadedImplSide_FullDamageEachFrame) {
+TEST_F(LayerTreeHostPerfTestJsonReader, TenTenThreaded_FullDamageEachFrame) {
full_damage_each_frame_ = true;
SetTestName("10_10_threaded_impl_side_full_damage_each_frame");
ReadTestFile("10_10_layer_tree");
- RunTestWithImplSidePainting();
+ RunTest(true, false);
}
// Invalidates a leaf layer in the tree on the main thread after every commit.
@@ -205,13 +204,13 @@ class LayerTreeHostPerfTestLeafInvalidates
TEST_F(LayerTreeHostPerfTestLeafInvalidates, TenTenSingleThread) {
SetTestName("10_10_single_thread_leaf_invalidates");
ReadTestFile("10_10_layer_tree");
- RunTest(false, false, false);
+ RunTest(false, false);
}
-TEST_F(LayerTreeHostPerfTestLeafInvalidates, TenTenThreadedImplSide) {
+TEST_F(LayerTreeHostPerfTestLeafInvalidates, TenTenThreaded) {
SetTestName("10_10_threaded_impl_side_leaf_invalidates");
ReadTestFile("10_10_layer_tree");
- RunTestWithImplSidePainting();
+ RunTest(true, false);
}
// Simulates main-thread scrolling on each frame.
@@ -246,18 +245,18 @@ TEST_F(ScrollingLayerTreePerfTest, LongScrollablePageSingleThread) {
// crbug.com/444219 is fixed.
bool old_verify_property_trees = verify_property_trees();
set_verify_property_trees(false);
- RunTest(false, false, false);
+ RunTest(false, false);
set_verify_property_trees(old_verify_property_trees);
}
-TEST_F(ScrollingLayerTreePerfTest, LongScrollablePageThreadedImplSide) {
+TEST_F(ScrollingLayerTreePerfTest, LongScrollablePageThreaded) {
SetTestName("long_scrollable_page_threaded_impl_side");
ReadTestFile("long_scrollable_page");
// TODO(vollick): Remove verify_property_trees setting after
// crbug.com/444219 is fixed.
bool old_verify_property_trees = verify_property_trees();
set_verify_property_trees(false);
- RunTestWithImplSidePainting();
+ RunTest(true, false);
set_verify_property_trees(old_verify_property_trees);
}
@@ -327,20 +326,20 @@ class BrowserCompositorInvalidateLayerTreePerfTest
bool clean_up_started_;
};
-TEST_F(BrowserCompositorInvalidateLayerTreePerfTest, DenseBrowserUI) {
+TEST_F(BrowserCompositorInvalidateLayerTreePerfTest, DenseBrowserUIThreaded) {
measure_commit_cost_ = true;
SetTestName("dense_layer_tree");
ReadTestFile("dense_layer_tree");
- RunTestWithImplSidePainting();
+ RunTest(true, false);
}
// Simulates a page with several large, transformed and animated layers.
-TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreadedImplSide) {
+TEST_F(LayerTreeHostPerfTestJsonReader, HeavyPageThreaded) {
begin_frame_driven_drawing_ = true;
measure_commit_cost_ = true;
SetTestName("heavy_page");
ReadTestFile("heavy_layer_tree");
- RunTestWithImplSidePainting();
+ RunTest(true, false);
}
} // namespace
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 904bdca..ffe090d 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -87,12 +87,9 @@ class LayerTreeHostTestHasImplThreadTest : public LayerTreeHostTest {
public:
LayerTreeHostTestHasImplThreadTest() : threaded_(false) {}
- void RunTest(bool threaded,
- bool delegating_renderer,
- bool impl_side_painting) override {
+ void RunTest(bool threaded, bool delegating_renderer) override {
threaded_ = threaded;
- LayerTreeHostTest::RunTest(threaded, delegating_renderer,
- impl_side_painting);
+ LayerTreeHostTest::RunTest(threaded, delegating_renderer);
}
void BeginTest() override {
@@ -106,7 +103,7 @@ class LayerTreeHostTestHasImplThreadTest : public LayerTreeHostTest {
bool threaded_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestHasImplThreadTest);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestHasImplThreadTest);
class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest {
protected:
@@ -125,8 +122,7 @@ class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest {
void AfterTest() override {}
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(
- LayerTreeHostTestSetNeedsCommitInsideLayout);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommitInsideLayout);
class LayerTreeHostTestSetNeedsUpdateInsideLayout : public LayerTreeHostTest {
protected:
@@ -145,8 +141,7 @@ class LayerTreeHostTestSetNeedsUpdateInsideLayout : public LayerTreeHostTest {
void AfterTest() override {}
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(
- LayerTreeHostTestSetNeedsUpdateInsideLayout);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsUpdateInsideLayout);
// Test if the LTHI receives ReadyToActivate notifications from the TileManager
// when no raster tasks get scheduled.
@@ -190,7 +185,7 @@ class LayerTreeHostTestReadyToActivateEmpty : public LayerTreeHostTest {
size_t required_for_activation_count_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestReadyToActivateEmpty);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToActivateEmpty);
// Test if the LTHI receives ReadyToActivate notifications from the TileManager
// when some raster tasks flagged as REQUIRED_FOR_ACTIVATION got scheduled.
@@ -220,7 +215,7 @@ class LayerTreeHostTestReadyToActivateNonEmpty
// Multi-thread only because in single thread the commit goes directly to the
// active tree, so notify ready to activate is skipped.
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestReadyToActivateNonEmpty);
+MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToActivateNonEmpty);
// Test if the LTHI receives ReadyToDraw notifications from the TileManager when
// no raster tasks get scheduled.
@@ -260,7 +255,7 @@ class LayerTreeHostTestReadyToDrawEmpty : public LayerTreeHostTest {
size_t required_for_draw_count_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestReadyToDrawEmpty);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToDrawEmpty);
// Test if the LTHI receives ReadyToDraw notifications from the TileManager when
// some raster tasks flagged as REQUIRED_FOR_DRAW got scheduled.
@@ -290,7 +285,7 @@ class LayerTreeHostTestReadyToDrawNonEmpty
// Note: With this test setup, we only get tiles flagged as REQUIRED_FOR_DRAW in
// single threaded mode.
-SINGLE_THREAD_IMPL_TEST_F(LayerTreeHostTestReadyToDrawNonEmpty);
+SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawNonEmpty);
// Two setNeedsCommits in a row should lead to at least 1 commit and at least 1
// draw with frame 0.
@@ -628,8 +623,7 @@ class LayerTreeHostTestGpuRasterDeviceSizeChanged : public LayerTreeHostTest {
scoped_refptr<FakePictureLayer> root_layer_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(
- LayerTreeHostTestGpuRasterDeviceSizeChanged);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged);
class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
public:
@@ -829,8 +823,8 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
scoped_refptr<Layer> root_layer_;
};
-SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
- LayerTreeHostTestSetNextCommitForcesRedraw);
+// This test blocks activation which is not supported for single thread mode.
+MULTI_THREAD_BLOCKNOTIFY_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw);
// Tests that if a layer is not drawn because of some reason in the parent then
// its damage is preserved until the next time it is drawn.
@@ -1037,79 +1031,7 @@ class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest {
scoped_refptr<Layer> child_layer_;
};
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestDamageWithScale);
-
-// Tests that if a layer is not drawn because of some reason in the parent,
-// causing its content bounds to not be computed, then when it is later drawn,
-// its content bounds get pushed.
-class LayerTreeHostTestUndrawnLayersPushContentBoundsLater
- : public LayerTreeHostTest {
- public:
- LayerTreeHostTestUndrawnLayersPushContentBoundsLater()
- : root_layer_(Layer::Create(layer_settings())) {}
-
- void SetupTree() override {
- root_layer_->CreateRenderSurface();
- root_layer_->SetIsDrawable(true);
- root_layer_->SetBounds(gfx::Size(20, 20));
- layer_tree_host()->SetRootLayer(root_layer_);
-
- parent_layer_ = Layer::Create(layer_settings());
- parent_layer_->SetBounds(gfx::Size(20, 20));
- parent_layer_->SetOpacity(0.0f);
- root_layer_->AddChild(parent_layer_);
-
- child_layer_ = Layer::Create(layer_settings());
- child_layer_->SetBounds(gfx::Size(15, 15));
- parent_layer_->AddChild(child_layer_);
-
- LayerTreeHostTest::SetupTree();
- }
-
- void BeginTest() override { PostSetNeedsCommitToMainThread(); }
-
- void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
- LayerImpl* root = host_impl->active_tree()->root_layer();
- LayerImpl* parent = root->children()[0];
- LayerImpl* child = parent->children()[0];
-
- switch (host_impl->active_tree()->source_frame_number()) {
- case 0:
- EXPECT_EQ(0.f, parent->opacity());
- EXPECT_EQ(gfx::SizeF(), child->content_bounds());
- break;
- case 1:
- EXPECT_EQ(1.f, parent->opacity());
- EXPECT_EQ(gfx::SizeF(15.f, 15.f), child->content_bounds());
- EndTest();
- break;
- default:
- NOTREACHED();
- }
- }
-
- void DidCommit() override {
- switch (layer_tree_host()->source_frame_number()) {
- case 1:
- parent_layer_->SetOpacity(1.0f);
- break;
- case 2:
- break;
- default:
- NOTREACHED();
- }
- }
-
- void AfterTest() override {}
-
- private:
- scoped_refptr<Layer> root_layer_;
- scoped_refptr<Layer> parent_layer_;
- scoped_refptr<Layer> child_layer_;
-};
-
-SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(
- LayerTreeHostTestUndrawnLayersPushContentBoundsLater);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDamageWithScale);
// This test verifies that properties on the layer tree host are commited
// to the impl side.
@@ -1196,7 +1118,8 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
base::TimeTicks first_frame_time_;
};
-SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
+// This test blocks activation which is not supported for single thread mode.
+MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
// This test verifies that LayerTreeHostImpl's current frame time gets
@@ -1324,7 +1247,8 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
scoped_refptr<Layer> scroll_layer_;
};
-MULTI_THREAD_NOIMPL_TEST_F(LayerTreeHostTestStartPageScaleAnimation);
+// Single thread proxy does not support impl-side page scale changes.
+MULTI_THREAD_TEST_F(LayerTreeHostTestStartPageScaleAnimation);
class LayerTreeHostTestSetVisible : public LayerTreeHostTest {
public:
@@ -1564,242 +1488,6 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers);
-static void SetLayerPropertiesForTesting(Layer* layer,
- Layer* parent,
- const gfx::Transform& transform,
- const gfx::Point3F& transform_origin,
- const gfx::PointF& position,
- const gfx::Size& bounds,
- bool opaque) {
- layer->RemoveAllChildren();
- if (parent)
- parent->AddChild(layer);
- layer->SetTransform(transform);
- layer->SetTransformOrigin(transform_origin);
- layer->SetPosition(position);
- layer->SetBounds(bounds);
- layer->SetContentsOpaque(opaque);
-}
-
-class EvictionTestLayer : public Layer {
- public:
- static scoped_refptr<EvictionTestLayer> Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new EvictionTestLayer(settings));
- }
-
- bool Update(ResourceUpdateQueue* queue) override;
- bool DrawsContent() const override { return true; }
-
- scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
- void PushPropertiesTo(LayerImpl* impl) override;
- void SetTexturePriorities(const PriorityCalculator&) override;
-
- bool HaveBackingTexture() const {
- return texture_.get() ? texture_->have_backing_texture() : false;
- }
-
- private:
- explicit EvictionTestLayer(const LayerSettings& settings) : Layer(settings) {}
- ~EvictionTestLayer() override {}
-
- void CreateTextureIfNeeded() {
- if (texture_)
- return;
- texture_ = PrioritizedResource::Create(
- layer_tree_host()->contents_texture_manager());
- texture_->SetDimensions(gfx::Size(10, 10), RGBA_8888);
- bitmap_.allocN32Pixels(10, 10);
- }
-
- scoped_ptr<PrioritizedResource> texture_;
- SkBitmap bitmap_;
-};
-
-class EvictionTestLayerImpl : public LayerImpl {
- public:
- static scoped_ptr<EvictionTestLayerImpl> Create(LayerTreeImpl* tree_impl,
- int id) {
- return make_scoped_ptr(new EvictionTestLayerImpl(tree_impl, id));
- }
- ~EvictionTestLayerImpl() override {}
-
- void AppendQuads(RenderPass* render_pass,
- AppendQuadsData* append_quads_data) override {
- ASSERT_TRUE(has_texture_);
- ASSERT_NE(0u, layer_tree_impl()->resource_provider()->num_resources());
- }
-
- void SetHasTexture(bool has_texture) { has_texture_ = has_texture; }
-
- private:
- EvictionTestLayerImpl(LayerTreeImpl* tree_impl, int id)
- : LayerImpl(tree_impl, id), has_texture_(false) {}
-
- bool has_texture_;
-};
-
-void EvictionTestLayer::SetTexturePriorities(const PriorityCalculator&) {
- CreateTextureIfNeeded();
- if (!texture_)
- return;
- texture_->set_request_priority(PriorityCalculator::UIPriority(true));
-}
-
-bool EvictionTestLayer::Update(ResourceUpdateQueue* queue) {
- CreateTextureIfNeeded();
- if (!texture_)
- return false;
-
- gfx::Rect full_rect(0, 0, 10, 10);
- ResourceUpdate upload = ResourceUpdate::Create(
- texture_.get(), &bitmap_, full_rect, full_rect, gfx::Vector2d());
- queue->AppendFullUpload(upload);
- return true;
-}
-
-scoped_ptr<LayerImpl> EvictionTestLayer::CreateLayerImpl(
- LayerTreeImpl* tree_impl) {
- return EvictionTestLayerImpl::Create(tree_impl, layer_id_);
-}
-
-void EvictionTestLayer::PushPropertiesTo(LayerImpl* layer_impl) {
- Layer::PushPropertiesTo(layer_impl);
-
- EvictionTestLayerImpl* test_layer_impl =
- static_cast<EvictionTestLayerImpl*>(layer_impl);
- test_layer_impl->SetHasTexture(texture_->have_backing_texture());
-}
-
-class LayerTreeHostTestEvictTextures : public LayerTreeHostTest {
- public:
- LayerTreeHostTestEvictTextures()
- : layer_(EvictionTestLayer::Create(layer_settings())),
- impl_for_evict_textures_(0),
- num_commits_(0) {}
-
- void BeginTest() override {
- layer_tree_host()->SetRootLayer(layer_);
- layer_tree_host()->SetViewportSize(gfx::Size(10, 20));
-
- gfx::Transform identity_matrix;
- SetLayerPropertiesForTesting(layer_.get(),
- 0,
- identity_matrix,
- gfx::Point3F(0.f, 0.f, 0.f),
- gfx::PointF(0.f, 0.f),
- gfx::Size(10, 20),
- true);
-
- PostSetNeedsCommitToMainThread();
- }
-
- void PostEvictTextures() {
- ImplThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&LayerTreeHostTestEvictTextures::EvictTexturesOnImplThread,
- base::Unretained(this)));
- }
-
- void EvictTexturesOnImplThread() {
- DCHECK(impl_for_evict_textures_);
- impl_for_evict_textures_->EvictTexturesForTesting();
- }
-
- // Commit 1: Just commit and draw normally, then post an eviction at the end
- // that will trigger a commit.
- // Commit 2: Triggered by the eviction, let it go through and then set
- // needsCommit.
- // Commit 3: Triggered by the setNeedsCommit. In Layout(), post an eviction
- // task, which will be handled before the commit. Don't set needsCommit, it
- // should have been posted. A frame should not be drawn (note,
- // didCommitAndDrawFrame may be called anyway).
- // Commit 4: Triggered by the eviction, let it go through and then set
- // needsCommit.
- // Commit 5: Triggered by the setNeedsCommit, post an eviction task in
- // Layout(), a frame should not be drawn but a commit will be posted.
- // Commit 6: Triggered by the eviction, post an eviction task in
- // Layout(), which will be a noop, letting the commit (which recreates the
- // textures) go through and draw a frame, then end the test.
- //
- // Commits 1+2 test the eviction recovery path where eviction happens outside
- // of the beginFrame/commit pair.
- // Commits 3+4 test the eviction recovery path where eviction happens inside
- // the beginFrame/commit pair.
- // Commits 5+6 test the path where an eviction happens during the eviction
- // recovery path.
- void DidCommit() override {
- switch (num_commits_) {
- case 1:
- EXPECT_TRUE(layer_->HaveBackingTexture());
- PostEvictTextures();
- break;
- case 2:
- EXPECT_TRUE(layer_->HaveBackingTexture());
- layer_tree_host()->SetNeedsCommit();
- break;
- case 3:
- break;
- case 4:
- EXPECT_TRUE(layer_->HaveBackingTexture());
- layer_tree_host()->SetNeedsCommit();
- break;
- case 5:
- break;
- case 6:
- EXPECT_TRUE(layer_->HaveBackingTexture());
- EndTest();
- break;
- default:
- NOTREACHED();
- break;
- }
- }
-
- void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
- impl_for_evict_textures_ = impl;
- }
-
- void Layout() override {
- ++num_commits_;
- switch (num_commits_) {
- case 1:
- case 2:
- break;
- case 3:
- PostEvictTextures();
- break;
- case 4:
- // We couldn't check in didCommitAndDrawFrame on commit 3,
- // so check here.
- EXPECT_FALSE(layer_->HaveBackingTexture());
- break;
- case 5:
- PostEvictTextures();
- break;
- case 6:
- // We couldn't check in didCommitAndDrawFrame on commit 5,
- // so check here.
- EXPECT_FALSE(layer_->HaveBackingTexture());
- PostEvictTextures();
- break;
- default:
- NOTREACHED();
- break;
- }
- }
-
- void AfterTest() override {}
-
- private:
- FakeContentLayerClient client_;
- scoped_refptr<EvictionTestLayer> layer_;
- LayerTreeHostImpl* impl_for_evict_textures_;
- int num_commits_;
-};
-
-MULTI_THREAD_NOIMPL_TEST_F(LayerTreeHostTestEvictTextures);
-
class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest {
public:
LayerTreeHostTestContinuousInvalidate()
@@ -2234,7 +1922,7 @@ class LayerTreeHostTestLCDChange : public LayerTreeHostTest {
int num_tiles_rastered_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestLCDChange);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLCDChange);
// Verify that the BeginFrame notification is used to initiate rendering.
class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest {
@@ -2403,7 +2091,7 @@ class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
FakeContentLayerClient client_;
};
-MULTI_THREAD_TEST_F(
+SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation);
class LayerTreeHostTestChangeLayerPropertiesInPaintContents
@@ -2760,7 +2448,7 @@ class LayerTreeHostTestResourcelessSoftwareDraw : public LayerTreeHostTest {
int swap_count_;
};
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestResourcelessSoftwareDraw);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestResourcelessSoftwareDraw);
// Test for UI Resource management.
class LayerTreeHostTestUIResource : public LayerTreeHostTest {
@@ -3338,9 +3026,8 @@ class LayerTreeHostTestImplLayersPushProperties
size_t expected_push_properties_grandchild2_impl_;
};
-TEST_F(LayerTreeHostTestImplLayersPushProperties, DelegatingRenderer) {
- RunTestWithImplSidePainting();
-}
+// In single thread there's no pending tree to push properties from.
+MULTI_THREAD_TEST_F(LayerTreeHostTestImplLayersPushProperties);
class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
: public LayerTreeHostTest {
@@ -3872,7 +3559,6 @@ class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest {
: num_commits_(0), callback_count_(0) {}
void BeginTest() override {
- EXPECT_TRUE(HasImplThread());
PostSetNeedsCommitToMainThread();
}
@@ -3924,13 +3610,7 @@ class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest {
int callback_count_;
};
-TEST_F(LayerTreeHostTestTreeActivationCallback, DirectRenderer) {
- RunTest(true, false, true);
-}
-
-TEST_F(LayerTreeHostTestTreeActivationCallback, DelegatingRenderer) {
- RunTest(true, true, true);
-}
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestTreeActivationCallback);
class LayerInvalidateCausesDraw : public LayerTreeHostTest {
public:
@@ -4015,9 +3695,7 @@ class LayerTreeHostTestIOSurfaceLayerInvalidate
}
};
-// TODO(danakj): IOSurface layer can not be transported. crbug.com/239335
-SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
- LayerTreeHostTestIOSurfaceLayerInvalidate);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestIOSurfaceLayerInvalidate);
class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
protected:
@@ -4234,99 +3912,6 @@ class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest {
// Impl-side painting is a multi-threaded compositor feature.
MULTI_THREAD_TEST_F(LayerTreeHostTestMaxTransferBufferUsageBytes);
-// Test ensuring that memory limits are sent to the prioritized resource
-// manager.
-class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest {
- public:
- LayerTreeHostTestMemoryLimits() : num_commits_(0) {}
-
- void BeginTest() override { PostSetNeedsCommitToMainThread(); }
-
- void WillCommit() override {
- // Some commits are aborted, so increment number of attempted commits here.
- num_commits_++;
- }
-
- void DidCommit() override {
- switch (num_commits_) {
- case 1:
- // Verify default values.
- EXPECT_EQ(PrioritizedResourceManager::DefaultMemoryAllocationLimit(),
- layer_tree_host()
- ->contents_texture_manager()
- ->MaxMemoryLimitBytes());
- EXPECT_EQ(PriorityCalculator::AllowEverythingCutoff(),
- layer_tree_host()
- ->contents_texture_manager()
- ->ExternalPriorityCutoff());
- PostSetNeedsCommitToMainThread();
- break;
- case 2:
- // The values should remain the same until the commit after the policy
- // is changed.
- EXPECT_EQ(PrioritizedResourceManager::DefaultMemoryAllocationLimit(),
- layer_tree_host()
- ->contents_texture_manager()
- ->MaxMemoryLimitBytes());
- EXPECT_EQ(PriorityCalculator::AllowEverythingCutoff(),
- layer_tree_host()
- ->contents_texture_manager()
- ->ExternalPriorityCutoff());
- break;
- case 3:
- // Verify values were correctly passed.
- EXPECT_EQ(16u * 1024u * 1024u,
- layer_tree_host()
- ->contents_texture_manager()
- ->MaxMemoryLimitBytes());
- EXPECT_EQ(PriorityCalculator::AllowVisibleAndNearbyCutoff(),
- layer_tree_host()
- ->contents_texture_manager()
- ->ExternalPriorityCutoff());
- EndTest();
- break;
- case 4:
- // Make sure no extra commits happen.
- NOTREACHED();
- break;
- }
- }
-
- void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
- switch (num_commits_) {
- case 1:
- break;
- case 2:
- // This will trigger a commit because the priority cutoff has changed.
- impl->SetMemoryPolicy(ManagedMemoryPolicy(
- 16u * 1024u * 1024u,
- gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
- 1000));
- break;
- case 3:
- // This will not trigger a commit because the priority cutoff has not
- // changed, and there is already enough memory for all allocations.
- impl->SetMemoryPolicy(ManagedMemoryPolicy(
- 32u * 1024u * 1024u,
- gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
- 1000));
- break;
- case 4:
- NOTREACHED();
- break;
- }
- }
-
- void AfterTest() override {}
-
- private:
- int num_commits_;
-};
-
-SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(LayerTreeHostTestMemoryLimits);
-
-} // namespace
-
class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface
: public LayerTreeHostTest {
protected:
@@ -5050,7 +4635,7 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
FakeContentLayerClient layer_client_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestGpuRasterizationForced);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationForced);
class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest {
public:
@@ -5327,7 +4912,8 @@ class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest {
};
// TODO(vmpstr): Enable with single thread impl-side painting.
-MULTI_THREAD_TEST_F(LayerTreeHostTestActivateOnInvisible);
+// This test blocks activation which is not supported for single thread mode.
+MULTI_THREAD_BLOCKNOTIFY_TEST_F(LayerTreeHostTestActivateOnInvisible);
// Do a synchronous composite and assert that the swap promise succeeds.
class LayerTreeHostTestSynchronousCompositeSwapPromise
@@ -5406,8 +4992,7 @@ class LayerTreeHostTestSynchronousCompositeSwapPromise
TestSwapPromiseResult swap_promise_result_[3];
};
-// Impl-side painting is not supported for synchronous compositing.
-SINGLE_THREAD_NOIMPL_TEST_F(LayerTreeHostTestSynchronousCompositeSwapPromise);
+SINGLE_THREAD_TEST_F(LayerTreeHostTestSynchronousCompositeSwapPromise);
// Make sure page scale and top control deltas are applied to the client even
// when the LayerTreeHost doesn't have a root layer.
@@ -5636,7 +5221,9 @@ class LayerTreeHostTestCrispUpAfterPinchEnds : public LayerTreeHostTest {
base::WaitableEvent playback_allowed_event_;
};
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestCrispUpAfterPinchEnds);
+// This test does pinching on the impl side which is not supported in single
+// thread.
+MULTI_THREAD_TEST_F(LayerTreeHostTestCrispUpAfterPinchEnds);
class LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy
: public LayerTreeHostTestCrispUpAfterPinchEnds {
@@ -5661,7 +5248,9 @@ class LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy
}
};
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy);
+// This test does pinching on the impl side which is not supported in single
+// thread.
+MULTI_THREAD_TEST_F(LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy);
class RasterizeWithGpuRasterizationCreatesResources : public LayerTreeHostTest {
protected:
@@ -5706,7 +5295,7 @@ class RasterizeWithGpuRasterizationCreatesResources : public LayerTreeHostTest {
FakeContentLayerClient client_;
};
-MULTI_THREAD_IMPL_TEST_F(RasterizeWithGpuRasterizationCreatesResources);
+SINGLE_AND_MULTI_THREAD_TEST_F(RasterizeWithGpuRasterizationCreatesResources);
class GpuRasterizationRasterizesBorderTiles : public LayerTreeHostTest {
protected:
@@ -5752,7 +5341,7 @@ class GpuRasterizationRasterizesBorderTiles : public LayerTreeHostTest {
gfx::Size viewport_size_;
};
-MULTI_THREAD_IMPL_TEST_F(GpuRasterizationRasterizesBorderTiles);
+SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationRasterizesBorderTiles);
class LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles
: public LayerTreeHostTest {
@@ -5989,7 +5578,7 @@ class LayerTreeHostTestOneActivatePerPrepareTiles : public LayerTreeHostTest {
size_t scheduled_prepare_tiles_count_;
};
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestOneActivatePerPrepareTiles);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestOneActivatePerPrepareTiles);
class LayerTreeHostTestFrameTimingRequestsSaveTimestamps
: public LayerTreeHostTest {
@@ -6075,7 +5664,8 @@ class LayerTreeHostTestFrameTimingRequestsSaveTimestamps
bool check_results_on_commit_;
};
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestFrameTimingRequestsSaveTimestamps);
+// Frame timing is not implemented in single thread proxy.
+MULTI_THREAD_TEST_F(LayerTreeHostTestFrameTimingRequestsSaveTimestamps);
class LayerTreeHostTestActivationCausesPrepareTiles : public LayerTreeHostTest {
public:
@@ -6119,7 +5709,9 @@ class LayerTreeHostTestActivationCausesPrepareTiles : public LayerTreeHostTest {
int scheduled_prepare_tiles_count_;
};
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestActivationCausesPrepareTiles);
+// This test is testing activation from a pending tree and doesn't make sense
+// with single thread commit-to-active.
+MULTI_THREAD_TEST_F(LayerTreeHostTestActivationCausesPrepareTiles);
// This tests an assertion that DidCommit and WillCommit happen in the same
// stack frame with no tasks that run between them. Various embedders of
@@ -6746,4 +6338,5 @@ class LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild);
+} // namespace
} // namespace cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 5585cfe..590559e 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -923,7 +923,8 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers
int frame_count_with_pending_tree_;
};
-SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
+// This test blocks activation which is not supported for single thread mode.
+MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers);
// When a layer with an animation is removed from the tree and later re-added,
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 8eb4dc8..421c8519 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -409,7 +409,8 @@ class MultipleCompositeDoesNotCreateOutputSurface
int request_count_;
};
-SINGLE_THREAD_NOIMPL_TEST_F(MultipleCompositeDoesNotCreateOutputSurface);
+// This test uses Composite() which only exists for single thread.
+SINGLE_THREAD_TEST_F(MultipleCompositeDoesNotCreateOutputSurface);
// This test makes sure that once a SingleThreadProxy issues a
// DidFailToInitializeOutputSurface, that future Composite calls will not
@@ -464,7 +465,8 @@ class FailedCreateDoesNotCreateExtraOutputSurface
bool has_failed_;
};
-SINGLE_THREAD_NOIMPL_TEST_F(FailedCreateDoesNotCreateExtraOutputSurface);
+// This test uses Composite() which only exists for single thread.
+SINGLE_THREAD_TEST_F(FailedCreateDoesNotCreateExtraOutputSurface);
class LayerTreeHostContextTestCommitAfterDelayedOutputSurface
: public LayerTreeHostContextTest {
@@ -505,8 +507,8 @@ class LayerTreeHostContextTestCommitAfterDelayedOutputSurface
bool creating_output_;
};
-SINGLE_THREAD_NOIMPL_TEST_F(
- LayerTreeHostContextTestCommitAfterDelayedOutputSurface);
+// This test uses Composite() which only exists for single thread.
+SINGLE_THREAD_TEST_F(LayerTreeHostContextTestCommitAfterDelayedOutputSurface);
class LayerTreeHostContextTestAvoidUnnecessaryComposite
: public LayerTreeHostContextTest {
@@ -538,8 +540,10 @@ class LayerTreeHostContextTestAvoidUnnecessaryComposite
bool in_composite_;
};
-SINGLE_THREAD_NOIMPL_TEST_F(LayerTreeHostContextTestAvoidUnnecessaryComposite);
+// This test uses Composite() which only exists for single thread.
+SINGLE_THREAD_TEST_F(LayerTreeHostContextTestAvoidUnnecessaryComposite);
+// This test uses PictureLayer to check for a working context.
class LayerTreeHostContextTestLostContextSucceedsWithContent
: public LayerTreeHostContextTestLostContextSucceeds {
public:
@@ -586,8 +590,7 @@ class LayerTreeHostContextTestLostContextSucceedsWithContent
scoped_refptr<Layer> layer_;
};
-// This test uses PictureLayer to check for a working context.
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(
+SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostContextTestLostContextSucceedsWithContent);
class LayerTreeHostContextTestCreateOutputSurfaceFailsOnce
@@ -709,49 +712,49 @@ class LayerTreeHostContextTestLostContextAndEvictTextures
TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures,
LoseAfterEvict_SingleThread_DirectRenderer) {
lose_after_evict_ = true;
- RunTest(false, false, true);
+ RunTest(false, false);
}
TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures,
LoseAfterEvict_SingleThread_DelegatingRenderer) {
lose_after_evict_ = true;
- RunTest(false, true, true);
+ RunTest(false, true);
}
TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures,
LoseAfterEvict_MultiThread_DirectRenderer) {
lose_after_evict_ = true;
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures,
LoseAfterEvict_MultiThread_DelegatingRenderer) {
lose_after_evict_ = true;
- RunTest(true, true, true);
+ RunTest(true, true);
}
TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures,
LoseBeforeEvict_SingleThread_DirectRenderer) {
lose_after_evict_ = false;
- RunTest(false, false, true);
+ RunTest(false, false);
}
TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures,
LoseBeforeEvict_SingleThread_DelegatingRenderer) {
lose_after_evict_ = false;
- RunTest(false, true, true);
+ RunTest(false, true);
}
TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures,
LoseBeforeEvict_MultiThread_DirectRenderer) {
lose_after_evict_ = false;
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostContextTestLostContextAndEvictTextures,
LoseBeforeEvict_MultiThread_DelegatingRenderer) {
lose_after_evict_ = false;
- RunTest(true, true, true);
+ RunTest(true, true);
}
class LayerTreeHostContextTestLayersNotified : public LayerTreeHostContextTest {
@@ -951,15 +954,12 @@ class LayerTreeHostContextTestDontUseLostResources
hw_frame_provider_.set_frame(hw_video_frame_);
scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_);
- if (!delegating_renderer()) {
- // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335
- scoped_refptr<IOSurfaceLayer> io_surface =
- IOSurfaceLayer::Create(layer_settings_);
- io_surface->SetBounds(gfx::Size(10, 10));
- io_surface->SetIsDrawable(true);
- io_surface->SetIOSurfaceProperties(1, gfx::Size(10, 10));
- root->AddChild(io_surface);
- }
+ scoped_refptr<IOSurfaceLayer> io_surface =
+ IOSurfaceLayer::Create(layer_settings_);
+ io_surface->SetBounds(gfx::Size(10, 10));
+ io_surface->SetIsDrawable(true);
+ io_surface->SetIOSurfaceProperties(1, gfx::Size(10, 10));
+ root->AddChild(io_surface);
// Enable the hud.
LayerTreeDebugState debug_state;
@@ -1083,7 +1083,7 @@ class LayerTreeHostContextTestImplSidePainting
FakeContentLayerClient client_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostContextTestImplSidePainting);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting);
class ScrollbarLayerLostContext : public LayerTreeHostContextTest {
public:
@@ -1437,15 +1437,7 @@ class UIResourceLostBeforeActivateTree : public UIResourceLostTest {
UIResourceId test_id_;
};
-TEST_F(UIResourceLostBeforeActivateTree,
- RunMultiThread_DirectRenderer_ImplSidePaint) {
- RunTest(true, false, true);
-}
-
-TEST_F(UIResourceLostBeforeActivateTree,
- RunMultiThread_DelegatingRenderer_ImplSidePaint) {
- RunTest(true, true, true);
-}
+SINGLE_AND_MULTI_THREAD_TEST_F(UIResourceLostBeforeActivateTree);
// Resources evicted explicitly and by visibility changes.
class UIResourceLostEviction : public UIResourceLostTestSimple {
diff --git a/cc/trees/layer_tree_host_unittest_copyrequest.cc b/cc/trees/layer_tree_host_unittest_copyrequest.cc
index 440063d..70e0c79 100644
--- a/cc/trees/layer_tree_host_unittest_copyrequest.cc
+++ b/cc/trees/layer_tree_host_unittest_copyrequest.cc
@@ -123,25 +123,25 @@ class LayerTreeHostCopyRequestTestMultipleRequests
TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
DISABLED_GLRenderer_RunSingleThread) {
use_gl_renderer_ = true;
- RunTest(false, false, false);
+ RunTest(false, false);
}
TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
- GLRenderer_RunMultiThread_MainThreadPainting) {
+ GLRenderer_RunMultiThread) {
use_gl_renderer_ = true;
- RunTest(true, false, false);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
SoftwareRenderer_RunSingleThread) {
use_gl_renderer_ = false;
- RunTest(false, false, false);
+ RunTest(false, false);
}
TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
- SoftwareRenderer_RunMultiThread_MainThreadPainting) {
+ SoftwareRenderer_RunMultiThread) {
use_gl_renderer_ = false;
- RunTest(true, false, false);
+ RunTest(true, false);
}
class LayerTreeHostCopyRequestTestLayerDestroyed
@@ -332,7 +332,7 @@ class LayerTreeHostCopyRequestTestInHiddenSubtree
scoped_refptr<FakePictureLayer> copy_layer_;
};
-SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_IMPL_TEST_F(
+SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
LayerTreeHostCopyRequestTestInHiddenSubtree);
class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest
@@ -529,7 +529,7 @@ class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw
scoped_refptr<FakePictureLayer> copy_layer_;
};
-SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_IMPL_TEST_F(
+SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
LayerTreeHostTestAsyncTwoReadbacksWithoutDraw);
class LayerTreeHostCopyRequestTestLostOutputSurface
@@ -657,7 +657,7 @@ class LayerTreeHostCopyRequestTestLostOutputSurface
scoped_ptr<CopyOutputResult> result_;
};
-SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_IMPL_TEST_F(
+SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
LayerTreeHostCopyRequestTestLostOutputSurface);
class LayerTreeHostCopyRequestTestCountTextures
@@ -765,7 +765,7 @@ class LayerTreeHostCopyRequestTestCreatesTexture
}
};
-SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_IMPL_TEST_F(
+SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
LayerTreeHostCopyRequestTestCreatesTexture);
class LayerTreeHostCopyRequestTestProvideTexture
@@ -818,7 +818,7 @@ class LayerTreeHostCopyRequestTestProvideTexture
unsigned sync_point_;
};
-SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_IMPL_TEST_F(
+SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
LayerTreeHostCopyRequestTestProvideTexture);
class LayerTreeHostCopyRequestTestDestroyBeforeCopy
diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc
index 4062236..5d5cf59 100644
--- a/cc/trees/layer_tree_host_unittest_damage.cc
+++ b/cc/trees/layer_tree_host_unittest_damage.cc
@@ -236,7 +236,7 @@ class LayerTreeHostDamageTestNoDamageDoesNotSwap
int did_swap_and_succeed_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostDamageTestNoDamageDoesNotSwap);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDamageTestNoDamageDoesNotSwap);
class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest {
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
@@ -332,7 +332,7 @@ class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest {
gfx::Rect child_damage_rect_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostDamageTestForcedFullDamage);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDamageTestForcedFullDamage);
class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest {
void SetupTree() override {
diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc
index 9b0a58a..2ebb337 100644
--- a/cc/trees/layer_tree_host_unittest_delegated.cc
+++ b/cc/trees/layer_tree_host_unittest_delegated.cc
@@ -430,7 +430,7 @@ class LayerTreeHostDelegatedTestDontUseLostChildIdAfterCommit
}
};
-MULTI_THREAD_IMPL_TEST_F(
+SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostDelegatedTestDontUseLostChildIdAfterCommit);
// Test that we can gracefully handle invalid frames after the context was lost.
@@ -2286,7 +2286,8 @@ class LayerTreeHostDelegatedTestActiveFrameIsValid
bool drew_with_pending_tree_;
};
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostDelegatedTestActiveFrameIsValid);
+// This test blocks activation which is not supported for single thread mode.
+MULTI_THREAD_BLOCKNOTIFY_TEST_F(LayerTreeHostDelegatedTestActiveFrameIsValid);
} // namespace
} // namespace cc
diff --git a/cc/trees/layer_tree_host_unittest_picture.cc b/cc/trees/layer_tree_host_unittest_picture.cc
index 208da58..811a384 100644
--- a/cc/trees/layer_tree_host_unittest_picture.cc
+++ b/cc/trees/layer_tree_host_unittest_picture.cc
@@ -128,7 +128,7 @@ class LayerTreeHostPictureTestTwinLayer
};
// There is no pending layers in single thread mode.
-MULTI_THREAD_IMPL_TEST_F(LayerTreeHostPictureTestTwinLayer);
+MULTI_THREAD_TEST_F(LayerTreeHostPictureTestTwinLayer);
class LayerTreeHostPictureTestResizeViewportWithGpuRaster
: public LayerTreeHostPictureTest {
@@ -191,7 +191,7 @@ class LayerTreeHostPictureTestResizeViewportWithGpuRaster
scoped_refptr<FakePictureLayer> picture_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(
+SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostPictureTestResizeViewportWithGpuRaster);
class LayerTreeHostPictureTestChangeLiveTilesRectWithRecycleTree
@@ -294,8 +294,7 @@ class LayerTreeHostPictureTestChangeLiveTilesRectWithRecycleTree
};
// Multi-thread only since there is no recycle tree in single thread.
-MULTI_THREAD_IMPL_TEST_F(
- LayerTreeHostPictureTestChangeLiveTilesRectWithRecycleTree);
+MULTI_THREAD_TEST_F(LayerTreeHostPictureTestChangeLiveTilesRectWithRecycleTree);
class LayerTreeHostPictureTestRSLLMembership : public LayerTreeHostPictureTest {
void SetupTree() override {
@@ -383,7 +382,7 @@ class LayerTreeHostPictureTestRSLLMembership : public LayerTreeHostPictureTest {
scoped_refptr<FakePictureLayer> picture_;
};
-SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostPictureTestRSLLMembership);
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostPictureTestRSLLMembership);
class LayerTreeHostPictureTestRSLLMembershipWithScale
: public LayerTreeHostPictureTest {
@@ -534,7 +533,7 @@ class LayerTreeHostPictureTestRSLLMembershipWithScale
// Multi-thread only because in single thread you can't pinch zoom on the
// compositor thread.
// Disabled due to flakiness. See http://crbug.com/460581
-// MULTI_THREAD_IMPL_TEST_F(LayerTreeHostPictureTestRSLLMembershipWithScale);
+// MULTI_THREAD_TEST_F(LayerTreeHostPictureTestRSLLMembershipWithScale);
} // namespace
} // namespace cc
diff --git a/cc/trees/layer_tree_host_unittest_proxy.cc b/cc/trees/layer_tree_host_unittest_proxy.cc
index 3135103..66340e7 100644
--- a/cc/trees/layer_tree_host_unittest_proxy.cc
+++ b/cc/trees/layer_tree_host_unittest_proxy.cc
@@ -7,16 +7,8 @@
#include "cc/test/layer_tree_test.h"
#include "cc/trees/thread_proxy.h"
-#define THREAD_PROXY_NO_IMPL_TEST_F(TEST_FIXTURE_NAME) \
- TEST_F(TEST_FIXTURE_NAME, Run_MainThreadPaint) { \
- Run(true, false); \
- }
-
-#define THREAD_PROXY_TEST_F(TEST_FIXTURE_NAME) \
- THREAD_PROXY_NO_IMPL_TEST_F(TEST_FIXTURE_NAME); \
- TEST_F(TEST_FIXTURE_NAME, Run_ImplSidePaint) { \
- Run(true, true); \
- }
+#define THREAD_PROXY_TEST_F(TEST_FIXTURE_NAME) \
+ TEST_F(TEST_FIXTURE_NAME, MultiThread) { Run(true); }
// Do common tests for single thread proxy and thread proxy.
// TODO(simonhong): Add SINGLE_THREAD_PROXY_TEST_F
@@ -30,11 +22,11 @@ class ProxyTest : public LayerTreeTest {
ProxyTest() {}
~ProxyTest() override {}
- void Run(bool threaded, bool impl_side_painting) {
+ void Run(bool threaded) {
// We don't need to care about delegating mode.
bool delegating_renderer = true;
- RunTest(threaded, delegating_renderer, impl_side_painting);
+ RunTest(threaded, delegating_renderer);
}
void BeginTest() override {}
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 36a3750..d1fe103 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -680,84 +680,84 @@ TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor1_ScrollChild_DirectRenderer) {
device_scale_factor_ = 1.f;
scroll_child_layer_ = true;
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor1_ScrollChild_DelegatingRenderer) {
device_scale_factor_ = 1.f;
scroll_child_layer_ = true;
- RunTest(true, true, true);
+ RunTest(true, true);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor15_ScrollChild_DirectRenderer) {
device_scale_factor_ = 1.5f;
scroll_child_layer_ = true;
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor15_ScrollChild_DelegatingRenderer) {
device_scale_factor_ = 1.5f;
scroll_child_layer_ = true;
- RunTest(true, true, true);
+ RunTest(true, true);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor2_ScrollChild_DirectRenderer) {
device_scale_factor_ = 2.f;
scroll_child_layer_ = true;
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor2_ScrollChild_DelegatingRenderer) {
device_scale_factor_ = 2.f;
scroll_child_layer_ = true;
- RunTest(true, true, true);
+ RunTest(true, true);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor1_ScrollRootScrollLayer_DirectRenderer) {
device_scale_factor_ = 1.f;
scroll_child_layer_ = false;
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor1_ScrollRootScrollLayer_DelegatingRenderer) {
device_scale_factor_ = 1.f;
scroll_child_layer_ = false;
- RunTest(true, true, true);
+ RunTest(true, true);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor15_ScrollRootScrollLayer_DirectRenderer) {
device_scale_factor_ = 1.5f;
scroll_child_layer_ = false;
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor15_ScrollRootScrollLayer_DelegatingRenderer) {
device_scale_factor_ = 1.5f;
scroll_child_layer_ = false;
- RunTest(true, true, true);
+ RunTest(true, true);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor2_ScrollRootScrollLayer_DirectRenderer) {
device_scale_factor_ = 2.f;
scroll_child_layer_ = false;
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostScrollTestCaseWithChild,
DeviceScaleFactor2_ScrollRootScrollLayer_DelegatingRenderer) {
device_scale_factor_ = 2.f;
scroll_child_layer_ = false;
- RunTest(true, true, true);
+ RunTest(true, true);
}
class ImplSidePaintingScrollTest : public LayerTreeHostScrollTest {
@@ -1245,12 +1245,12 @@ class LayerTreeHostScrollTestLayerStructureChange
};
TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyLayer) {
- RunTest(true, false, true);
+ RunTest(true, false);
}
TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) {
scroll_destroy_whole_tree_ = true;
- RunTest(true, false, true);
+ RunTest(true, false);
}
} // namespace