diff options
Diffstat (limited to 'cc/trees/layer_tree_impl_unittest.cc')
-rw-r--r-- | cc/trees/layer_tree_impl_unittest.cc | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index b27a06e..4a8259e 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -1185,110 +1185,6 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) { EXPECT_EQ(4, result_layer->id()); } -TEST_F(LayerTreeImplTest, HitTestingForEmptyLayers) { - // Layer 1 - root - scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); - gfx::Transform identity_matrix; - gfx::PointF anchor; - gfx::PointF position; - gfx::Size bounds(100, 100); - SetLayerPropertiesForTesting( - root.get(), identity_matrix, anchor, position, bounds, true, false); - root->SetDrawsContent(true); - - { - // Layer 2 - empty: drawsContent=false - gfx::PointF position(10.f, 10.f); - gfx::Size bounds(30, 30); - scoped_ptr<LayerImpl> empty_layer = - LayerImpl::Create(host_impl().active_tree(), 2); - SetLayerPropertiesForTesting(empty_layer.get(), - identity_matrix, - anchor, - position, - bounds, - true, - false); - - empty_layer->SetDrawsContent(false); - root->AddChild(empty_layer.Pass()); - } - - { - // Layer 3 - empty, but has touch handler - gfx::PointF position(10.f, 60.f); - gfx::Size bounds(30, 30); - scoped_ptr<LayerImpl> test_layer = - LayerImpl::Create(host_impl().active_tree(), 3); - SetLayerPropertiesForTesting(test_layer.get(), - identity_matrix, - anchor, - position, - bounds, - true, - false); - - test_layer->SetDrawsContent(false); - Region touch_handler_region(gfx::Rect(10, 10, 10, 10)); - test_layer->SetTouchEventHandlerRegion(touch_handler_region); - root->AddChild(test_layer.Pass()); - } - - { - // Layer 4 - empty, but has mousewheel handler - gfx::PointF position(60.f, 60.f); - gfx::Size bounds(30, 30); - scoped_ptr<LayerImpl> test_layer = - LayerImpl::Create(host_impl().active_tree(), 4); - SetLayerPropertiesForTesting(test_layer.get(), - identity_matrix, - anchor, - position, - bounds, - true, - false); - - test_layer->SetDrawsContent(false); - test_layer->SetHaveWheelEventHandlers(true); - root->AddChild(test_layer.Pass()); - } - - host_impl().SetViewportSize(root->bounds()); - host_impl().active_tree()->SetRootLayer(root.Pass()); - host_impl().active_tree()->UpdateDrawProperties(); - - // Verify that the root layer and empty layers with touch/wheel handlers - // (but not the empty layer without a touch handler) are in the RSSL. - ASSERT_EQ(1u, RenderSurfaceLayerList().size()); - EXPECT_EQ(1, RenderSurfaceLayerList()[0]->id()); - ASSERT_EQ(3u, root_layer()->render_surface()->layer_list().size()); - EXPECT_EQ(1, root_layer()->render_surface()->layer_list().at(0)->id()); - EXPECT_EQ(3, root_layer()->render_surface()->layer_list().at(1)->id()); - EXPECT_EQ(4, root_layer()->render_surface()->layer_list().at(2)->id()); - - // Hit testing for a point inside the empty no-handlers layer should return - // the root layer. - gfx::Point test_point = gfx::Point(15, 15); - LayerImpl* result_layer = - host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); - ASSERT_TRUE(result_layer); - EXPECT_EQ(1, result_layer->id()); - - // Hit testing for a point inside the touch handler layer should return it. - test_point = gfx::Point(15, 75); - result_layer = - host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); - ASSERT_TRUE(result_layer); - EXPECT_EQ(3, result_layer->id()); - - // Hit testing for a point inside the mousewheel layer should return it. - test_point = gfx::Point(75, 75); - result_layer = - host_impl().active_tree()->FindLayerThatIsHitByPoint(test_point); - ASSERT_TRUE(result_layer); - EXPECT_EQ(4, result_layer->id()); -} - TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) { scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 12345); |