summaryrefslogtreecommitdiffstats
path: root/chromium/cc/trees/layer_tree_impl_unittest.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-05 17:15:33 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-11 07:47:18 +0000
commit7324afb043a0b1e623d8e8eb906cdc53bdeb4685 (patch)
treea3fe2d74ea9c9e142c390dac4ca0e219382ace46 /chromium/cc/trees/layer_tree_impl_unittest.cc
parent6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (diff)
BASELINE: Update Chromium to 58.0.3029.54
Change-Id: I67f57065a7afdc8e4614adb5c0230281428df4d1 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/cc/trees/layer_tree_impl_unittest.cc')
-rw-r--r--chromium/cc/trees/layer_tree_impl_unittest.cc70
1 files changed, 31 insertions, 39 deletions
diff --git a/chromium/cc/trees/layer_tree_impl_unittest.cc b/chromium/cc/trees/layer_tree_impl_unittest.cc
index 8b33f9092f0..81d2800c986 100644
--- a/chromium/cc/trees/layer_tree_impl_unittest.cc
+++ b/chromium/cc/trees/layer_tree_impl_unittest.cc
@@ -136,7 +136,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root_layer()->GetRenderSurface()->layer_list().size());
// Hit testing for a point outside the layer should return a null pointer.
gfx::PointF test_point(101.f, 101.f);
@@ -205,7 +205,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerAndHud) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(2u, root_layer()->render_surface()->layer_list().size());
+ ASSERT_EQ(2u, root_layer()->GetRenderSurface()->layer_list().size());
// Hit testing for a point inside HUD, but outside root should return null
gfx::PointF test_point(101.f, 101.f);
@@ -257,7 +257,7 @@ TEST_F(LayerTreeImplTest, HitTestingForUninvertibleTransform) {
skip_verify_visible_rect_calculations);
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root_layer()->GetRenderSurface()->layer_list().size());
ASSERT_FALSE(root_layer()->ScreenSpaceTransform().IsInvertible());
// Hit testing any point should not hit the layer. If the invertible matrix is
@@ -312,7 +312,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePositionedLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root_layer()->GetRenderSurface()->layer_list().size());
// Hit testing for a point outside the layer should return a null pointer.
gfx::PointF test_point(49.f, 49.f);
@@ -357,7 +357,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleRotatedLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root_layer()->GetRenderSurface()->layer_list().size());
// Hit testing for points outside the layer.
// These corners would have been inside the un-transformed layer, but they
@@ -529,7 +529,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSinglePerspectiveLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root_layer()->GetRenderSurface()->layer_list().size());
// Hit testing for points outside the layer.
// These corners would have been inside the un-transformed layer, but they
@@ -587,8 +587,8 @@ TEST_F(LayerTreeImplTest, HitTestingForSimpleClippedLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size());
- ASSERT_EQ(456, root_layer()->render_surface()->layer_list().at(0)->id());
+ ASSERT_EQ(1u, root_layer()->GetRenderSurface()->layer_list().size());
+ ASSERT_EQ(456, root_layer()->GetRenderSurface()->layer_list().at(0)->id());
// Hit testing for a point outside the layer should return a null pointer.
// Despite the child layer being very large, it should be clipped to the root
@@ -766,8 +766,8 @@ TEST_F(LayerTreeImplTest, HitTestingForNonClippingIntermediateLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size());
- ASSERT_EQ(456, root_layer()->render_surface()->layer_list().at(0)->id());
+ ASSERT_EQ(1u, root_layer()->GetRenderSurface()->layer_list().size());
+ ASSERT_EQ(456, root_layer()->GetRenderSurface()->layer_list().at(0)->id());
// Hit testing for a point outside the layer should return a null pointer.
gfx::PointF test_point(69.f, 69.f);
@@ -847,7 +847,7 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayers) {
ASSERT_TRUE(grand_child1);
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- RenderSurfaceImpl* root_render_surface = root->render_surface();
+ RenderSurfaceImpl* root_render_surface = root->GetRenderSurface();
ASSERT_EQ(4u, root_render_surface->layer_list().size());
ASSERT_EQ(1, root_render_surface->layer_list().at(0)->id()); // root layer
ASSERT_EQ(2, root_render_surface->layer_list().at(1)->id()); // child1
@@ -1066,7 +1066,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsClipParents) {
grand_child->SetPosition(gfx::PointF(0.f, 40.f));
grand_child->SetBounds(gfx::Size(100, 50));
grand_child->SetDrawsContent(true);
- grand_child->SetHasRenderSurface(true);
+ grand_child->test_properties()->force_render_surface = true;
// This should let |grand_child| "escape" |child|'s clip.
grand_child->test_properties()->clip_parent = root;
@@ -1118,7 +1118,7 @@ TEST_F(LayerTreeImplTest, HitTestingRespectsScrollParents) {
grand_child->SetBounds(gfx::Size(200, 200));
grand_child->SetDrawsContent(true);
- grand_child->SetHasRenderSurface(true);
+ grand_child->test_properties()->force_render_surface = true;
scroll_child->test_properties()->AddChild(std::move(grand_child));
root->test_properties()->AddChild(std::move(scroll_child));
@@ -1194,17 +1194,17 @@ TEST_F(LayerTreeImplTest, HitTestingForMultipleLayerLists) {
ASSERT_TRUE(child1);
ASSERT_TRUE(child2);
ASSERT_TRUE(grand_child1);
- ASSERT_TRUE(child1->render_surface());
- ASSERT_TRUE(child2->render_surface());
- ASSERT_TRUE(grand_child1->render_surface());
+ ASSERT_TRUE(child1->GetRenderSurface());
+ ASSERT_TRUE(child2->GetRenderSurface());
+ ASSERT_TRUE(grand_child1->GetRenderSurface());
ASSERT_EQ(4u, RenderSurfaceLayerList().size());
// The root surface has the root layer, and child1's and child2's render
// surfaces.
- ASSERT_EQ(3u, root->render_surface()->layer_list().size());
+ ASSERT_EQ(3u, root->GetRenderSurface()->layer_list().size());
// The child1 surface has the child1 layer and grand_child1's render surface.
- ASSERT_EQ(2u, child1->render_surface()->layer_list().size());
- ASSERT_EQ(1u, child2->render_surface()->layer_list().size());
- ASSERT_EQ(1u, grand_child1->render_surface()->layer_list().size());
+ ASSERT_EQ(2u, child1->GetRenderSurface()->layer_list().size());
+ ASSERT_EQ(1u, child2->GetRenderSurface()->layer_list().size());
+ ASSERT_EQ(1u, grand_child1->GetRenderSurface()->layer_list().size());
ASSERT_EQ(1, RenderSurfaceLayerList().at(0)->id()); // root layer
ASSERT_EQ(2, RenderSurfaceLayerList()[1]->id()); // child1
ASSERT_EQ(4, RenderSurfaceLayerList().at(2)->id()); // grand_child1
@@ -1270,7 +1270,7 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSingleLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root->GetRenderSurface()->layer_list().size());
// Hit checking for any point should return a null pointer for a layer without
// any touch event handler regions.
@@ -1354,7 +1354,7 @@ TEST_F(LayerTreeImplTest,
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root->GetRenderSurface()->layer_list().size());
ASSERT_FALSE(root->ScreenSpaceTransform().IsInvertible());
// Hit checking any point should not hit the touch handler region on the
@@ -1421,7 +1421,7 @@ TEST_F(LayerTreeImplTest,
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root->GetRenderSurface()->layer_list().size());
// Hit checking for a point outside the layer should return a null pointer.
gfx::PointF test_point(49.f, 49.f);
@@ -1506,7 +1506,7 @@ TEST_F(LayerTreeImplTest,
// its layout size is 50x50, positioned at 25x25.
LayerImpl* test_layer = root->test_properties()->children[0];
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root->GetRenderSurface()->layer_list().size());
// Check whether the child layer fits into the root after scaled.
EXPECT_EQ(gfx::Rect(test_layer->bounds()), test_layer->visible_layer_rect());
@@ -1633,8 +1633,8 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerRegionsForSimpleClippedLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root->render_surface()->layer_list().size());
- ASSERT_EQ(456, root->render_surface()->layer_list().at(0)->id());
+ ASSERT_EQ(1u, root->GetRenderSurface()->layer_list().size());
+ ASSERT_EQ(456, root->GetRenderSurface()->layer_list().at(0)->id());
// Hit checking for a point outside the layer should return a null pointer.
// Despite the child layer being very large, it should be clipped to the root
@@ -1786,9 +1786,9 @@ TEST_F(LayerTreeImplTest, HitCheckingTouchHandlerOverlappingRegions) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(2u, root->render_surface()->layer_list().size());
- ASSERT_EQ(123, root->render_surface()->layer_list().at(0)->id());
- ASSERT_EQ(1234, root->render_surface()->layer_list().at(1)->id());
+ ASSERT_EQ(2u, root->GetRenderSurface()->layer_list().size());
+ ASSERT_EQ(123, root->GetRenderSurface()->layer_list().at(0)->id());
+ ASSERT_EQ(1234, root->GetRenderSurface()->layer_list().at(1)->id());
gfx::PointF test_point(35.f, 35.f);
LayerImpl* result_layer =
@@ -1844,7 +1844,7 @@ TEST_F(LayerTreeImplTest, HitTestingTouchHandlerRegionsForLayerThatIsNotDrawn) {
// As test_layer doesn't draw content, the layer list of root's render surface
// should contain only the root layer.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root->GetRenderSurface()->layer_list().size());
// Hit testing for a point outside the test layer should return null pointer.
// We also implicitly check that the updated screen space transform of a layer
@@ -1902,7 +1902,7 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) {
// Sanity check the scenario we just created.
ASSERT_EQ(1u, RenderSurfaceLayerList().size());
- ASSERT_EQ(1u, root->render_surface()->layer_list().size());
+ ASSERT_EQ(1u, root->GetRenderSurface()->layer_list().size());
LayerSelection input;
@@ -1934,9 +1934,6 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) {
EXPECT_EQ(gfx::PointF(input.end.edge_bottom), output.end.edge_bottom());
EXPECT_EQ(gfx::PointF(input.end.edge_top), output.end.edge_top());
EXPECT_TRUE(output.end.visible());
- EXPECT_EQ(input.is_editable, output.is_editable);
- EXPECT_EQ(input.is_empty_text_form_control,
- output.is_empty_text_form_control);
// Insertion bounds should produce identical left and right bounds.
LayerSelection insertion_input;
@@ -1944,8 +1941,6 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) {
insertion_input.start.edge_top = gfx::Point(15, 10);
insertion_input.start.edge_bottom = gfx::Point(15, 30);
insertion_input.start.layer_id = root->id();
- insertion_input.is_editable = true;
- insertion_input.is_empty_text_form_control = true;
insertion_input.end = insertion_input.start;
host_impl().active_tree()->RegisterSelection(insertion_input);
host_impl().active_tree()->GetViewportSelection(&output);
@@ -1954,9 +1949,6 @@ TEST_F(LayerTreeImplTest, SelectionBoundsForSingleLayer) {
output.start.edge_bottom());
EXPECT_EQ(gfx::PointF(insertion_input.start.edge_top),
output.start.edge_top());
- EXPECT_EQ(insertion_input.is_editable, output.is_editable);
- EXPECT_EQ(insertion_input.is_empty_text_form_control,
- output.is_empty_text_form_control);
EXPECT_TRUE(output.start.visible());
EXPECT_EQ(output.start, output.end);
}