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 4027e14443f030fdb4aa05cac54592874a64ab50..63180f3af735540d02d1e9bf73b5867f784e1390 100644 |
--- a/cc/trees/layer_tree_host_unittest.cc |
+++ b/cc/trees/layer_tree_host_unittest.cc |
@@ -4921,6 +4921,65 @@ class LayerTreeHostTestNoQuadsForEmptyLayer : public LayerTreeHostTest { |
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoQuadsForEmptyLayer); |
+class LayerTreeHostTestNoQuadsForZeroOpacity : public LayerTreeHostTest { |
+ protected: |
+ virtual void SetupTree() OVERRIDE { |
+ LayerTreeHostTest::SetupTree(); |
+ root_layer_ = FakeContentLayer::Create(&client_); |
+ root_layer_->SetBounds(gfx::Size(100, 100)); |
+ |
+ surface_layer1_ = FakeContentLayer::Create(&client_); |
+ surface_layer1_->SetBounds(gfx::Size(100, 100)); |
+ surface_layer1_->SetForceRenderSurface(true); |
+ surface_layer1_->SetOpacity(0.f); |
+ |
+ surface_layer2_ = FakeContentLayer::Create(&client_); |
+ surface_layer2_->SetBounds(gfx::Size(50, 50)); |
+ surface_layer2_->SetForceRenderSurface(true); |
+ |
+ touch_handler_ = FakeContentLayer::Create(&client_); |
+ touch_handler_->SetBounds(gfx::Size(50, 50)); |
+ touch_handler_->SetPosition(gfx::Point(50, 0)); |
+ touch_handler_->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 50, 50)); |
+ |
+ surface_layer2_->AddChild(touch_handler_); |
+ surface_layer1_->AddChild(surface_layer2_); |
+ root_layer_->AddChild(surface_layer1_); |
+ |
+ layer_tree_host()->SetRootLayer(root_layer_); |
+ LayerTreeHostTest::SetupTree(); |
+ } |
+ |
+ virtual void BeginTest() OVERRIDE { |
+ PostSetNeedsCommitToMainThread(); |
+ } |
+ |
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
+ FakeContentLayerImpl* layer_impl = |
+ static_cast<FakeContentLayerImpl*>(impl->RootLayer()); |
+ |
+ FakeContentLayerImpl* surface_1_impl = |
+ static_cast<FakeContentLayerImpl*>(layer_impl->children()[0]); |
+ FakeContentLayerImpl* surface_2_impl = |
+ static_cast<FakeContentLayerImpl*>(surface_1_impl->children()[0]); |
+ EXPECT_EQ(0u, surface_1_impl->append_quads_count()); |
+ EXPECT_EQ(0u, surface_2_impl->append_quads_count()); |
+ |
+ EndTest(); |
+ } |
+ |
+ virtual void AfterTest() OVERRIDE {} |
+ |
+ private: |
+ FakeContentLayerClient client_; |
+ scoped_refptr<FakeContentLayer> root_layer_; |
+ scoped_refptr<FakeContentLayer> surface_layer1_; |
+ scoped_refptr<FakeContentLayer> surface_layer2_; |
+ scoped_refptr<FakeContentLayer> touch_handler_; |
+}; |
+ |
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoQuadsForZeroOpacity); |
+ |
} // namespace |