diff options
author | hush <hush@chromium.org> | 2014-12-04 14:37:32 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-04 22:38:02 +0000 |
commit | 6b61421f5b702f90617ffeff3ed83ab044c55ad9 (patch) | |
tree | 58594f58c441c2f7675be1bd42b2e90ee4c0f802 /cc | |
parent | 258cddfdb22627e42793771dc3a01f5b1cb1cc07 (diff) | |
download | chromium_src-6b61421f5b702f90617ffeff3ed83ab044c55ad9.zip chromium_src-6b61421f5b702f90617ffeff3ed83ab044c55ad9.tar.gz chromium_src-6b61421f5b702f90617ffeff3ed83ab044c55ad9.tar.bz2 |
Use EXPECT_EQ when possible.
EXPECT_RECT_EQ, EXPECT_SIZE_EQ, EXPECT_POINT_EQ, EXPECT_POINT3F_EQ
could be replaced by EXPECT_EQ.
Follow up of https://codereview.chromium.org/751453005/
Review URL: https://codereview.chromium.org/774763004
Cr-Commit-Position: refs/heads/master@{#306913}
Diffstat (limited to 'cc')
-rw-r--r-- | cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc | 12 | ||||
-rw-r--r-- | cc/animation/scrollbar_animation_controller_thinning_unittest.cc | 6 | ||||
-rw-r--r-- | cc/base/tiling_data_unittest.cc | 98 | ||||
-rw-r--r-- | cc/blink/web_layer_impl_fixed_bounds_unittest.cc | 5 | ||||
-rw-r--r-- | cc/layers/nine_patch_layer_impl_unittest.cc | 4 | ||||
-rw-r--r-- | cc/layers/render_surface_unittest.cc | 5 | ||||
-rw-r--r-- | cc/layers/scrollbar_layer_unittest.cc | 26 | ||||
-rw-r--r-- | cc/layers/tiled_layer_unittest.cc | 12 | ||||
-rw-r--r-- | cc/output/overlay_unittest.cc | 4 | ||||
-rw-r--r-- | cc/quads/draw_polygon_unittest.cc | 7 | ||||
-rw-r--r-- | cc/quads/draw_quad_unittest.cc | 48 | ||||
-rw-r--r-- | cc/quads/render_pass_unittest.cc | 8 | ||||
-rw-r--r-- | cc/test/geometry_test_utils.h | 27 | ||||
-rw-r--r-- | cc/test/layer_tree_json_parser_unittest.cc | 7 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_common_unittest.cc | 239 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 10 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 23 | ||||
-rw-r--r-- | cc/trees/layer_tree_impl_unittest.cc | 8 |
18 files changed, 246 insertions, 303 deletions
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc index 3f01c54..4c8b49b 100644 --- a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc +++ b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc @@ -130,13 +130,13 @@ TEST_F(ScrollbarAnimationControllerLinearFadeTest, TEST_F(ScrollbarAnimationControllerLinearFadeTest, HideOnResize) { LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1); ASSERT_TRUE(scroll_layer); - EXPECT_SIZE_EQ(gfx::Size(200, 200), scroll_layer->bounds()); + EXPECT_EQ(gfx::Size(200, 200), scroll_layer->bounds()); EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation()); // Shrink along X axis, horizontal scrollbar should appear. clip_layer_->SetBounds(gfx::Size(100, 200)); - EXPECT_SIZE_EQ(gfx::Size(100, 200), clip_layer_->bounds()); + EXPECT_EQ(gfx::Size(100, 200), clip_layer_->bounds()); scrollbar_controller_->DidScrollBegin(); @@ -148,7 +148,7 @@ TEST_F(ScrollbarAnimationControllerLinearFadeTest, HideOnResize) { // Shrink along Y axis and expand along X, horizontal scrollbar // should disappear. clip_layer_->SetBounds(gfx::Size(200, 100)); - EXPECT_SIZE_EQ(gfx::Size(200, 100), clip_layer_->bounds()); + EXPECT_EQ(gfx::Size(200, 100), clip_layer_->bounds()); scrollbar_controller_->DidScrollBegin(); @@ -161,13 +161,13 @@ TEST_F(ScrollbarAnimationControllerLinearFadeTest, HideOnResize) { TEST_F(VerticalScrollbarAnimationControllerLinearFadeTest, HideOnResize) { LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1); ASSERT_TRUE(scroll_layer); - EXPECT_SIZE_EQ(gfx::Size(200, 200), scroll_layer->bounds()); + EXPECT_EQ(gfx::Size(200, 200), scroll_layer->bounds()); EXPECT_EQ(VERTICAL, scrollbar_layer_->orientation()); // Shrink along X axis, vertical scrollbar should remain invisible. clip_layer_->SetBounds(gfx::Size(100, 200)); - EXPECT_SIZE_EQ(gfx::Size(100, 200), clip_layer_->bounds()); + EXPECT_EQ(gfx::Size(100, 200), clip_layer_->bounds()); scrollbar_controller_->DidScrollBegin(); @@ -178,7 +178,7 @@ TEST_F(VerticalScrollbarAnimationControllerLinearFadeTest, HideOnResize) { // Shrink along Y axis and expand along X, vertical scrollbar should appear. clip_layer_->SetBounds(gfx::Size(200, 100)); - EXPECT_SIZE_EQ(gfx::Size(200, 100), clip_layer_->bounds()); + EXPECT_EQ(gfx::Size(200, 100), clip_layer_->bounds()); scrollbar_controller_->DidScrollBegin(); diff --git a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc index d46431b..74e9517 100644 --- a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc +++ b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc @@ -85,13 +85,13 @@ TEST_F(ScrollbarAnimationControllerThinningTest, Idle) { TEST_F(ScrollbarAnimationControllerThinningTest, HideOnResize) { LayerImpl* scroll_layer = host_impl_.active_tree()->LayerById(1); ASSERT_TRUE(scroll_layer); - EXPECT_SIZE_EQ(gfx::Size(200, 200), scroll_layer->bounds()); + EXPECT_EQ(gfx::Size(200, 200), scroll_layer->bounds()); EXPECT_EQ(HORIZONTAL, scrollbar_layer_->orientation()); // Shrink along X axis, horizontal scrollbar should appear. clip_layer_->SetBounds(gfx::Size(100, 200)); - EXPECT_SIZE_EQ(gfx::Size(100, 200), clip_layer_->bounds()); + EXPECT_EQ(gfx::Size(100, 200), clip_layer_->bounds()); scrollbar_controller_->DidScrollBegin(); @@ -103,7 +103,7 @@ TEST_F(ScrollbarAnimationControllerThinningTest, HideOnResize) { // Shrink along Y axis and expand along X, horizontal scrollbar // should disappear. clip_layer_->SetBounds(gfx::Size(200, 100)); - EXPECT_SIZE_EQ(gfx::Size(200, 100), clip_layer_->bounds()); + EXPECT_EQ(gfx::Size(200, 100), clip_layer_->bounds()); scrollbar_controller_->DidScrollBegin(); diff --git a/cc/base/tiling_data_unittest.cc b/cc/base/tiling_data_unittest.cc index 667719b..732b04d 100644 --- a/cc/base/tiling_data_unittest.cc +++ b/cc/base/tiling_data_unittest.cc @@ -775,26 +775,23 @@ TEST(TilingDataTest, SetMaxTextureSizeBorders) { TEST(TilingDataTest, ExpandRectIgnoringBordersToTileBoundsEmpty) { TilingData empty_total_size(gfx::Size(0, 0), gfx::Size(8, 8), true); - EXPECT_RECT_EQ( - gfx::Rect(), - empty_total_size.ExpandRectIgnoringBordersToTileBounds(gfx::Rect())); - EXPECT_RECT_EQ(gfx::Rect(), - empty_total_size.ExpandRectIgnoringBordersToTileBounds( - gfx::Rect(100, 100, 100, 100))); - EXPECT_RECT_EQ(gfx::Rect(), - empty_total_size.ExpandRectIgnoringBordersToTileBounds( - gfx::Rect(100, 100))); + EXPECT_EQ(gfx::Rect(), empty_total_size.ExpandRectIgnoringBordersToTileBounds( + gfx::Rect())); + EXPECT_EQ(gfx::Rect(), empty_total_size.ExpandRectIgnoringBordersToTileBounds( + gfx::Rect(100, 100, 100, 100))); + EXPECT_EQ(gfx::Rect(), empty_total_size.ExpandRectIgnoringBordersToTileBounds( + gfx::Rect(100, 100))); TilingData empty_max_texture_size(gfx::Size(8, 8), gfx::Size(0, 0), true); - EXPECT_RECT_EQ(gfx::Rect(), - empty_max_texture_size.ExpandRectIgnoringBordersToTileBounds( - gfx::Rect())); - EXPECT_RECT_EQ(gfx::Rect(), - empty_max_texture_size.ExpandRectIgnoringBordersToTileBounds( - gfx::Rect(100, 100, 100, 100))); - EXPECT_RECT_EQ(gfx::Rect(), - empty_max_texture_size.ExpandRectIgnoringBordersToTileBounds( - gfx::Rect(100, 100))); + EXPECT_EQ(gfx::Rect(), + empty_max_texture_size.ExpandRectIgnoringBordersToTileBounds( + gfx::Rect())); + EXPECT_EQ(gfx::Rect(), + empty_max_texture_size.ExpandRectIgnoringBordersToTileBounds( + gfx::Rect(100, 100, 100, 100))); + EXPECT_EQ(gfx::Rect(), + empty_max_texture_size.ExpandRectIgnoringBordersToTileBounds( + gfx::Rect(100, 100))); } TEST(TilingDataTest, ExpandRectIgnoringBordersToTileBounds) { @@ -804,8 +801,8 @@ TEST(TilingDataTest, ExpandRectIgnoringBordersToTileBounds) { gfx::Rect at_origin_src(1, 1); gfx::Rect at_origin_result(data.TileBounds(0, 0)); EXPECT_NE(at_origin_src, at_origin_result); - EXPECT_RECT_EQ(at_origin_result, - data.ExpandRectIgnoringBordersToTileBounds(at_origin_src)); + EXPECT_EQ(at_origin_result, + data.ExpandRectIgnoringBordersToTileBounds(at_origin_src)); // Arbitrary internal rect. gfx::Rect rect_src(6, 6, 1, 3); @@ -814,32 +811,30 @@ TEST(TilingDataTest, ExpandRectIgnoringBordersToTileBounds) { gfx::Rect rect_result( gfx::UnionRects(data.TileBounds(2, 2), data.TileBounds(2, 3))); EXPECT_NE(rect_src, rect_result); - EXPECT_RECT_EQ(rect_result, - data.ExpandRectIgnoringBordersToTileBounds(rect_src)); + EXPECT_EQ(rect_result, data.ExpandRectIgnoringBordersToTileBounds(rect_src)); // On tile bounds does not round up to next tile (ignores the border). gfx::Rect border_rect_src( gfx::UnionRects(data.TileBounds(1, 2), data.TileBounds(3, 4))); gfx::Rect border_rect_result( gfx::UnionRects(data.TileBounds(1, 2), data.TileBounds(3, 4))); - EXPECT_RECT_EQ(border_rect_result, - data.ExpandRectIgnoringBordersToTileBounds(border_rect_src)); + EXPECT_EQ(border_rect_result, + data.ExpandRectIgnoringBordersToTileBounds(border_rect_src)); // Equal to tiling rect. - EXPECT_RECT_EQ(gfx::Rect(data.tiling_size()), - data.ExpandRectIgnoringBordersToTileBounds( - gfx::Rect(data.tiling_size()))); + EXPECT_EQ(gfx::Rect(data.tiling_size()), + data.ExpandRectIgnoringBordersToTileBounds( + gfx::Rect(data.tiling_size()))); // Containing, but larger than tiling rect. - EXPECT_RECT_EQ( - gfx::Rect(data.tiling_size()), - data.ExpandRectIgnoringBordersToTileBounds(gfx::Rect(100, 100))); + EXPECT_EQ(gfx::Rect(data.tiling_size()), + data.ExpandRectIgnoringBordersToTileBounds(gfx::Rect(100, 100))); // Non-intersecting with tiling rect. gfx::Rect non_intersect(200, 200, 100, 100); EXPECT_FALSE(non_intersect.Intersects(gfx::Rect(data.tiling_size()))); - EXPECT_RECT_EQ(gfx::Rect(), - data.ExpandRectIgnoringBordersToTileBounds(non_intersect)); + EXPECT_EQ(gfx::Rect(), + data.ExpandRectIgnoringBordersToTileBounds(non_intersect)); TilingData data2(gfx::Size(8, 8), gfx::Size(32, 64), true); @@ -859,7 +854,7 @@ TEST(TilingDataTest, ExpandRectToTileBounds) { gfx::Rect at_origin_src(1, 1); gfx::Rect at_origin_result(data.TileBounds(0, 0)); EXPECT_NE(at_origin_src, at_origin_result); - EXPECT_RECT_EQ(at_origin_result, data.ExpandRectToTileBounds(at_origin_src)); + EXPECT_EQ(at_origin_result, data.ExpandRectToTileBounds(at_origin_src)); // Arbitrary internal rect. gfx::Rect rect_src(6, 6, 1, 3); @@ -868,28 +863,27 @@ TEST(TilingDataTest, ExpandRectToTileBounds) { gfx::Rect rect_result( gfx::UnionRects(data.TileBounds(2, 2), data.TileBounds(3, 4))); EXPECT_NE(rect_src, rect_result); - EXPECT_RECT_EQ(rect_result, data.ExpandRectToTileBounds(rect_src)); + EXPECT_EQ(rect_result, data.ExpandRectToTileBounds(rect_src)); // On tile bounds rounds up to next tile (since border overlaps). gfx::Rect border_rect_src( gfx::UnionRects(data.TileBounds(1, 2), data.TileBounds(3, 4))); gfx::Rect border_rect_result( gfx::UnionRects(data.TileBounds(0, 1), data.TileBounds(4, 5))); - EXPECT_RECT_EQ(border_rect_result, - data.ExpandRectToTileBounds(border_rect_src)); + EXPECT_EQ(border_rect_result, data.ExpandRectToTileBounds(border_rect_src)); // Equal to tiling rect. - EXPECT_RECT_EQ(gfx::Rect(data.tiling_size()), - data.ExpandRectToTileBounds(gfx::Rect(data.tiling_size()))); + EXPECT_EQ(gfx::Rect(data.tiling_size()), + data.ExpandRectToTileBounds(gfx::Rect(data.tiling_size()))); // Containing, but larger than tiling rect. - EXPECT_RECT_EQ(gfx::Rect(data.tiling_size()), - data.ExpandRectToTileBounds(gfx::Rect(100, 100))); + EXPECT_EQ(gfx::Rect(data.tiling_size()), + data.ExpandRectToTileBounds(gfx::Rect(100, 100))); // Non-intersecting with tiling rect. gfx::Rect non_intersect(200, 200, 100, 100); EXPECT_FALSE(non_intersect.Intersects(gfx::Rect(data.tiling_size()))); - EXPECT_RECT_EQ(gfx::Rect(), data.ExpandRectToTileBounds(non_intersect)); + EXPECT_EQ(gfx::Rect(), data.ExpandRectToTileBounds(non_intersect)); TilingData data2(gfx::Size(8, 8), gfx::Size(32, 64), true); @@ -953,17 +947,17 @@ TEST(TilingDataTest, LargeBorders) { EXPECT_EQ(35, data.TileSizeY(4)); EXPECT_EQ(5, data.num_tiles_y()); - EXPECT_RECT_EQ(gfx::Rect(70, 50), data.TileBounds(0, 0)); - EXPECT_RECT_EQ(gfx::Rect(70, 50, 40, 20), data.TileBounds(1, 1)); - EXPECT_RECT_EQ(gfx::Rect(110, 110, 40, 35), data.TileBounds(2, 4)); - EXPECT_RECT_EQ(gfx::Rect(150, 70, 50, 20), data.TileBounds(3, 2)); - EXPECT_RECT_EQ(gfx::Rect(150, 110, 50, 35), data.TileBounds(3, 4)); - - EXPECT_RECT_EQ(gfx::Rect(100, 80), data.TileBoundsWithBorder(0, 0)); - EXPECT_RECT_EQ(gfx::Rect(40, 20, 100, 80), data.TileBoundsWithBorder(1, 1)); - EXPECT_RECT_EQ(gfx::Rect(80, 80, 100, 65), data.TileBoundsWithBorder(2, 4)); - EXPECT_RECT_EQ(gfx::Rect(120, 40, 80, 80), data.TileBoundsWithBorder(3, 2)); - EXPECT_RECT_EQ(gfx::Rect(120, 80, 80, 65), data.TileBoundsWithBorder(3, 4)); + EXPECT_EQ(gfx::Rect(70, 50), data.TileBounds(0, 0)); + EXPECT_EQ(gfx::Rect(70, 50, 40, 20), data.TileBounds(1, 1)); + EXPECT_EQ(gfx::Rect(110, 110, 40, 35), data.TileBounds(2, 4)); + EXPECT_EQ(gfx::Rect(150, 70, 50, 20), data.TileBounds(3, 2)); + EXPECT_EQ(gfx::Rect(150, 110, 50, 35), data.TileBounds(3, 4)); + + EXPECT_EQ(gfx::Rect(100, 80), data.TileBoundsWithBorder(0, 0)); + EXPECT_EQ(gfx::Rect(40, 20, 100, 80), data.TileBoundsWithBorder(1, 1)); + EXPECT_EQ(gfx::Rect(80, 80, 100, 65), data.TileBoundsWithBorder(2, 4)); + EXPECT_EQ(gfx::Rect(120, 40, 80, 80), data.TileBoundsWithBorder(3, 2)); + EXPECT_EQ(gfx::Rect(120, 80, 80, 65), data.TileBoundsWithBorder(3, 4)); EXPECT_EQ(0, data.TileXIndexFromSrcCoord(0)); EXPECT_EQ(0, data.TileXIndexFromSrcCoord(69)); diff --git a/cc/blink/web_layer_impl_fixed_bounds_unittest.cc b/cc/blink/web_layer_impl_fixed_bounds_unittest.cc index ceeb311..083b0cf 100644 --- a/cc/blink/web_layer_impl_fixed_bounds_unittest.cc +++ b/cc/blink/web_layer_impl_fixed_bounds_unittest.cc @@ -53,9 +53,8 @@ void CheckBoundsScaleSimple(WebLayerImplFixedBounds* layer, original_point.y() * bounds.height / fixed_bounds.height(), original_point.z()); // Test if the bounds scale is correctly applied in transform. - EXPECT_POINT3F_EQ( - scaled_point, - TransformPoint(layer->layer()->transform(), original_point)); + EXPECT_EQ(scaled_point, + TransformPoint(layer->layer()->transform(), original_point)); } TEST(WebLayerImplFixedBoundsTest, BoundsScaleSimple) { diff --git a/cc/layers/nine_patch_layer_impl_unittest.cc b/cc/layers/nine_patch_layer_impl_unittest.cc index f6262d3..c901a97 100644 --- a/cc/layers/nine_patch_layer_impl_unittest.cc +++ b/cc/layers/nine_patch_layer_impl_unittest.cc @@ -80,7 +80,7 @@ void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, // Check if the left-over quad is the same size as the mapped aperture quad in // layer space. if (!fill_center) { - EXPECT_RECT_EQ(expected_remaining, gfx::ToEnclosedRect(remaining.bounds())); + EXPECT_EQ(expected_remaining, gfx::ToEnclosedRect(remaining.bounds())); } else { EXPECT_TRUE(remaining.bounds().IsEmpty()); } @@ -97,7 +97,7 @@ void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, } if (!fill_center) { - EXPECT_RECT_EQ(aperture_rect, tex_remaining.bounds()); + EXPECT_EQ(aperture_rect, tex_remaining.bounds()); Region aperture_region(aperture_rect); EXPECT_EQ(aperture_region, tex_remaining); } else { diff --git a/cc/layers/render_surface_unittest.cc b/cc/layers/render_surface_unittest.cc index 8175efa..6a3e168 100644 --- a/cc/layers/render_surface_unittest.cc +++ b/cc/layers/render_surface_unittest.cc @@ -131,8 +131,7 @@ TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) { EXPECT_EQ( 40.0, shared_quad_state->content_to_target_transform.matrix().getDouble(1, 3)); - EXPECT_RECT_EQ(content_rect, - gfx::Rect(shared_quad_state->visible_content_rect)); + EXPECT_EQ(content_rect, gfx::Rect(shared_quad_state->visible_content_rect)); EXPECT_EQ(1.f, shared_quad_state->opacity); EXPECT_EQ(blend_mode, shared_quad_state->blend_mode); } @@ -182,7 +181,7 @@ TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectRenderPass) { RenderPass* pass = pass_sink.RenderPasses()[0]; EXPECT_EQ(RenderPassId(2, 0), pass->id); - EXPECT_RECT_EQ(content_rect, pass->output_rect); + EXPECT_EQ(content_rect, pass->output_rect); EXPECT_EQ(origin, pass->transform_to_root_target); } diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index 8a998f3..09de7d0 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -352,7 +352,7 @@ TEST(ScrollbarLayerTest, SolidColorDrawQuads) { const QuadList& quads = render_pass->quad_list; ASSERT_EQ(1u, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads.front()->material); - EXPECT_RECT_EQ(gfx::Rect(6, 0, 39, 3), quads.front()->rect); + EXPECT_EQ(gfx::Rect(6, 0, 39, 3), quads.front()->rect); } // Contents scale should scale the draw quad. @@ -366,7 +366,7 @@ TEST(ScrollbarLayerTest, SolidColorDrawQuads) { const QuadList& quads = render_pass->quad_list; ASSERT_EQ(1u, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads.front()->material); - EXPECT_RECT_EQ(gfx::Rect(12, 0, 78, 6), quads.front()->rect); + EXPECT_EQ(gfx::Rect(12, 0, 78, 6), quads.front()->rect); } scrollbar_layer_impl->draw_properties().contents_scale_x = 1.f; scrollbar_layer_impl->draw_properties().contents_scale_y = 1.f; @@ -382,7 +382,7 @@ TEST(ScrollbarLayerTest, SolidColorDrawQuads) { const QuadList& quads = render_pass->quad_list; ASSERT_EQ(1u, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads.front()->material); - EXPECT_RECT_EQ(gfx::Rect(8, 0, 19, 3), quads.front()->rect); + EXPECT_EQ(gfx::Rect(8, 0, 19, 3), quads.front()->rect); } // We shouldn't attempt div-by-zero when the maximum is zero. @@ -396,7 +396,7 @@ TEST(ScrollbarLayerTest, SolidColorDrawQuads) { const QuadList& quads = render_pass->quad_list; ASSERT_EQ(1u, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads.front()->material); - EXPECT_RECT_EQ(gfx::Rect(1, 0, 19, 3), quads.front()->rect); + EXPECT_EQ(gfx::Rect(1, 0, 19, 3), quads.front()->rect); } } @@ -455,7 +455,7 @@ TEST(ScrollbarLayerTest, LayerDrivenSolidColorDrawQuads) { const QuadList& quads = render_pass->quad_list; ASSERT_EQ(1u, quads.size()); EXPECT_EQ(DrawQuad::SOLID_COLOR, quads.front()->material); - EXPECT_RECT_EQ(gfx::Rect(3, 0, 3, 3), quads.front()->rect); + EXPECT_EQ(gfx::Rect(3, 0, 3, 3), quads.front()->rect); } } @@ -544,10 +544,10 @@ TEST_F(ScrollbarLayerSolidColorThumbTest, SolidColorThumbVerticalAdjust) { layers[0]->SetBounds(gfx::Size(100, 3)); layers[1]->SetBounds(gfx::Size(3, 100)); - EXPECT_RECT_EQ(gfx::RectF(20.f, 0.f, 20.f, 3.f), - horizontal_scrollbar_layer_->ComputeThumbQuadRect()); - EXPECT_RECT_EQ(gfx::RectF(0.f, 20.f, 3.f, 20.f), - vertical_scrollbar_layer_->ComputeThumbQuadRect()); + EXPECT_EQ(gfx::RectF(20.f, 0.f, 20.f, 3.f), + horizontal_scrollbar_layer_->ComputeThumbQuadRect()); + EXPECT_EQ(gfx::RectF(0.f, 20.f, 3.f, 20.f), + vertical_scrollbar_layer_->ComputeThumbQuadRect()); horizontal_scrollbar_layer_->SetVerticalAdjust(10.f); vertical_scrollbar_layer_->SetVerticalAdjust(10.f); @@ -556,10 +556,10 @@ TEST_F(ScrollbarLayerSolidColorThumbTest, SolidColorThumbVerticalAdjust) { // 1.) Moves the horizontal scrollbar down // 2.) Increases the vertical scrollbar's effective track length which both // increases the thumb's length and its position within the track. - EXPECT_RECT_EQ(gfx::Rect(20.f, 10.f, 20.f, 3.f), - horizontal_scrollbar_layer_->ComputeThumbQuadRect()); - EXPECT_RECT_EQ(gfx::Rect(0.f, 22, 3.f, 22.f), - vertical_scrollbar_layer_->ComputeThumbQuadRect()); + EXPECT_EQ(gfx::Rect(20.f, 10.f, 20.f, 3.f), + horizontal_scrollbar_layer_->ComputeThumbQuadRect()); + EXPECT_EQ(gfx::Rect(0.f, 22, 3.f, 22.f), + vertical_scrollbar_layer_->ComputeThumbQuadRect()); } class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc index 512fa51..a9a1e78 100644 --- a/cc/layers/tiled_layer_unittest.cc +++ b/cc/layers/tiled_layer_unittest.cc @@ -1711,7 +1711,7 @@ TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) { layer->Update(queue_.get(), nullptr); layer->tracking_layer_painter()->ResetPaintedRect(); - EXPECT_RECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect()); + EXPECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect()); UpdateTextures(); // Invalidate the entire layer in content space. When painting, the rect given @@ -1722,8 +1722,8 @@ TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) { // Rounding leads to an extra pixel. gfx::Rect expanded_layer_rect(layer_rect); expanded_layer_rect.set_height(32); - EXPECT_RECT_EQ(expanded_layer_rect, - layer->tracking_layer_painter()->PaintedRect()); + EXPECT_EQ(expanded_layer_rect, + layer->tracking_layer_painter()->PaintedRect()); } TEST_F(TiledLayerTest, @@ -1750,7 +1750,7 @@ TEST_F(TiledLayerTest, layer->Update(queue_.get(), nullptr); layer->tracking_layer_painter()->ResetPaintedRect(); - EXPECT_RECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect()); + EXPECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect()); UpdateTextures(); // Invalidate the entire layer in layer space. When painting, the rect given @@ -1761,8 +1761,8 @@ TEST_F(TiledLayerTest, // Rounding leads to an extra pixel. gfx::Rect expanded_layer_rect(layer_rect); expanded_layer_rect.set_height(32); - EXPECT_RECT_EQ(expanded_layer_rect, - layer->tracking_layer_painter()->PaintedRect()); + EXPECT_EQ(expanded_layer_rect, + layer->tracking_layer_painter()->PaintedRect()); } } // namespace diff --git a/cc/output/overlay_unittest.cc b/cc/output/overlay_unittest.cc index bb7451d..c98b3e8 100644 --- a/cc/output/overlay_unittest.cc +++ b/cc/output/overlay_unittest.cc @@ -205,10 +205,10 @@ static void CompareRenderPassLists(const RenderPassList& expected_list, RenderPass* actual = actual_list[i]; EXPECT_EQ(expected->id, actual->id); - EXPECT_RECT_EQ(expected->output_rect, actual->output_rect); + EXPECT_EQ(expected->output_rect, actual->output_rect); EXPECT_EQ(expected->transform_to_root_target, actual->transform_to_root_target); - EXPECT_RECT_EQ(expected->damage_rect, actual->damage_rect); + EXPECT_EQ(expected->damage_rect, actual->damage_rect); EXPECT_EQ(expected->has_transparent_background, actual->has_transparent_background); diff --git a/cc/quads/draw_polygon_unittest.cc b/cc/quads/draw_polygon_unittest.cc index 27cfed4..360a014 100644 --- a/cc/quads/draw_polygon_unittest.cc +++ b/cc/quads/draw_polygon_unittest.cc @@ -19,16 +19,11 @@ namespace { #define EXPECT_FLOAT_WITHIN_EPSILON_OF(a, b) \ EXPECT_TRUE(std::abs(a - b) < std::numeric_limits<float>::epsilon()); -#define EXPECT_POINT_EQ(point_a, point_b) \ - EXPECT_FLOAT_EQ(point_a.x(), point_b.x()); \ - EXPECT_FLOAT_EQ(point_a.y(), point_b.y()); \ - EXPECT_FLOAT_EQ(point_a.z(), point_b.z()); - static void ValidatePoints(const DrawPolygon& polygon, const std::vector<gfx::Point3F>& points) { EXPECT_EQ(polygon.points().size(), points.size()); for (size_t i = 0; i < points.size(); i++) { - EXPECT_POINT_EQ(polygon.points()[i], points[i]); + EXPECT_EQ(polygon.points()[i], points[i]); } } diff --git a/cc/quads/draw_quad_unittest.cc b/cc/quads/draw_quad_unittest.cc index 95c646b..e65b326 100644 --- a/cc/quads/draw_quad_unittest.cc +++ b/cc/quads/draw_quad_unittest.cc @@ -55,9 +55,9 @@ TEST(DrawQuadTest, CopySharedQuadState) { scoped_ptr<SharedQuadState> copy(new SharedQuadState); copy->CopyFrom(state.get()); EXPECT_EQ(quad_transform, copy->content_to_target_transform); - EXPECT_RECT_EQ(visible_content_rect, copy->visible_content_rect); + EXPECT_EQ(visible_content_rect, copy->visible_content_rect); EXPECT_EQ(opacity, copy->opacity); - EXPECT_RECT_EQ(clip_rect, copy->clip_rect); + EXPECT_EQ(clip_rect, copy->clip_rect); EXPECT_EQ(is_clipped, copy->is_clipped); EXPECT_EQ(blend_mode, copy->blend_mode); } @@ -88,9 +88,9 @@ void CompareDrawQuad(DrawQuad* quad, DrawQuad* copy, SharedQuadState* copy_shared_state) { EXPECT_EQ(quad->material, copy->material); - EXPECT_RECT_EQ(quad->rect, copy->rect); - EXPECT_RECT_EQ(quad->visible_rect, copy->visible_rect); - EXPECT_RECT_EQ(quad->opaque_rect, copy->opaque_rect); + EXPECT_EQ(quad->rect, copy->rect); + EXPECT_EQ(quad->visible_rect, copy->visible_rect); + EXPECT_EQ(quad->opaque_rect, copy->opaque_rect); EXPECT_EQ(quad->needs_blending, copy->needs_blending); EXPECT_EQ(copy_shared_state, copy->shared_quad_state); } @@ -373,7 +373,7 @@ TEST(DrawQuadTest, CopyCheckerboardDrawQuad) { CREATE_QUAD_2_NEW(CheckerboardDrawQuad, visible_rect, color); EXPECT_EQ(DrawQuad::CHECKERBOARD, copy_quad->material); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); EXPECT_EQ(color, copy_quad->color); CREATE_QUAD_1_ALL(CheckerboardDrawQuad, color); @@ -389,7 +389,7 @@ TEST(DrawQuadTest, CopyDebugBorderDrawQuad) { CREATE_QUAD_3_NEW(DebugBorderDrawQuad, visible_rect, color, width); EXPECT_EQ(DrawQuad::DEBUG_BORDER, copy_quad->material); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); EXPECT_EQ(color, copy_quad->color); EXPECT_EQ(width, copy_quad->width); @@ -414,8 +414,8 @@ TEST(DrawQuadTest, CopyIOSurfaceDrawQuad) { resource_id, orientation); EXPECT_EQ(DrawQuad::IO_SURFACE_CONTENT, copy_quad->material); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); - EXPECT_RECT_EQ(opaque_rect, copy_quad->opaque_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); EXPECT_EQ(size, copy_quad->io_surface_size); EXPECT_EQ(resource_id, copy_quad->io_surface_resource_id); EXPECT_EQ(orientation, copy_quad->orientation); @@ -454,7 +454,7 @@ TEST(DrawQuadTest, CopyRenderPassDrawQuad) { background_filters, copied_render_pass_id); EXPECT_EQ(DrawQuad::RENDER_PASS, copy_quad->material); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); EXPECT_EQ(copied_render_pass_id, copy_quad->render_pass_id); EXPECT_EQ(mask_resource_id, copy_quad->mask_resource_id); EXPECT_EQ(mask_uv_scale.ToString(), copy_quad->mask_uv_scale.ToString()); @@ -493,7 +493,7 @@ TEST(DrawQuadTest, CopySolidColorDrawQuad) { CREATE_QUAD_3_NEW( SolidColorDrawQuad, visible_rect, color, force_anti_aliasing_off); EXPECT_EQ(DrawQuad::SOLID_COLOR, copy_quad->material); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); EXPECT_EQ(color, copy_quad->color); EXPECT_EQ(force_anti_aliasing_off, copy_quad->force_anti_aliasing_off); @@ -513,8 +513,8 @@ TEST(DrawQuadTest, CopyStreamVideoDrawQuad) { CREATE_QUAD_4_NEW( StreamVideoDrawQuad, opaque_rect, visible_rect, resource_id, matrix); EXPECT_EQ(DrawQuad::STREAM_VIDEO_CONTENT, copy_quad->material); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); - EXPECT_RECT_EQ(opaque_rect, copy_quad->opaque_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); EXPECT_EQ(resource_id, copy_quad->resource_id); EXPECT_EQ(matrix, copy_quad->matrix); @@ -531,7 +531,7 @@ TEST(DrawQuadTest, CopySurfaceDrawQuad) { CREATE_QUAD_2_NEW(SurfaceDrawQuad, visible_rect, surface_id); EXPECT_EQ(DrawQuad::SURFACE_CONTENT, copy_quad->material); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); EXPECT_EQ(surface_id, copy_quad->surface_id); CREATE_QUAD_1_ALL(SurfaceDrawQuad, surface_id); @@ -564,8 +564,8 @@ TEST(DrawQuadTest, CopyTextureDrawQuad) { flipped, nearest_neighbor); EXPECT_EQ(DrawQuad::TEXTURE_CONTENT, copy_quad->material); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); - EXPECT_RECT_EQ(opaque_rect, copy_quad->opaque_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); EXPECT_EQ(resource_id, copy_quad->resource_id); EXPECT_EQ(premultiplied_alpha, copy_quad->premultiplied_alpha); EXPECT_EQ(uv_top_left, copy_quad->uv_top_left); @@ -610,8 +610,8 @@ TEST(DrawQuadTest, CopyTileDrawQuad) { texture_size, swizzle_contents); EXPECT_EQ(DrawQuad::TILED_CONTENT, copy_quad->material); - EXPECT_RECT_EQ(opaque_rect, copy_quad->opaque_rect); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); EXPECT_EQ(resource_id, copy_quad->resource_id); EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect); EXPECT_EQ(texture_size, copy_quad->texture_size); @@ -650,8 +650,8 @@ TEST(DrawQuadTest, CopyYUVVideoDrawQuad) { a_plane_resource_id, color_space); EXPECT_EQ(DrawQuad::YUV_VIDEO_CONTENT, copy_quad->material); - EXPECT_RECT_EQ(opaque_rect, copy_quad->opaque_rect); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect); EXPECT_EQ(y_plane_resource_id, copy_quad->y_plane_resource_id); EXPECT_EQ(u_plane_resource_id, copy_quad->u_plane_resource_id); @@ -690,12 +690,12 @@ TEST(DrawQuadTest, CopyPictureDrawQuad) { texture_size, texture_format, content_rect, contents_scale, raster_source); EXPECT_EQ(DrawQuad::PICTURE_CONTENT, copy_quad->material); - EXPECT_RECT_EQ(opaque_rect, copy_quad->opaque_rect); - EXPECT_RECT_EQ(visible_rect, copy_quad->visible_rect); + EXPECT_EQ(opaque_rect, copy_quad->opaque_rect); + EXPECT_EQ(visible_rect, copy_quad->visible_rect); EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect); EXPECT_EQ(texture_size, copy_quad->texture_size); EXPECT_EQ(texture_format, copy_quad->texture_format); - EXPECT_RECT_EQ(content_rect, copy_quad->content_rect); + EXPECT_EQ(content_rect, copy_quad->content_rect); EXPECT_EQ(contents_scale, copy_quad->contents_scale); EXPECT_EQ(raster_source, copy_quad->raster_source); @@ -706,7 +706,7 @@ TEST(DrawQuadTest, CopyPictureDrawQuad) { EXPECT_EQ(tex_coord_rect, copy_quad->tex_coord_rect); EXPECT_EQ(texture_size, copy_quad->texture_size); EXPECT_EQ(texture_format, copy_quad->texture_format); - EXPECT_RECT_EQ(content_rect, copy_quad->content_rect); + EXPECT_EQ(content_rect, copy_quad->content_rect); EXPECT_EQ(contents_scale, copy_quad->contents_scale); EXPECT_EQ(raster_source, copy_quad->raster_source); } diff --git a/cc/quads/render_pass_unittest.cc b/cc/quads/render_pass_unittest.cc index 4c3753f..8775d81 100644 --- a/cc/quads/render_pass_unittest.cc +++ b/cc/quads/render_pass_unittest.cc @@ -41,10 +41,10 @@ static void CompareRenderPassLists(const RenderPassList& expected_list, RenderPass* actual = actual_list[i]; EXPECT_EQ(expected->id, actual->id); - EXPECT_RECT_EQ(expected->output_rect, actual->output_rect); + EXPECT_EQ(expected->output_rect, actual->output_rect); EXPECT_EQ(expected->transform_to_root_target, actual->transform_to_root_target); - EXPECT_RECT_EQ(expected->damage_rect, actual->damage_rect); + EXPECT_EQ(expected->damage_rect, actual->damage_rect); EXPECT_EQ(expected->has_transparent_background, actual->has_transparent_background); @@ -99,9 +99,9 @@ TEST(RenderPassTest, CopyShouldBeIdenticalExceptIdAndQuads) { scoped_ptr<RenderPass> copy = pass->Copy(new_id); EXPECT_EQ(new_id, copy->id); - EXPECT_RECT_EQ(pass->output_rect, copy->output_rect); + EXPECT_EQ(pass->output_rect, copy->output_rect); EXPECT_EQ(pass->transform_to_root_target, copy->transform_to_root_target); - EXPECT_RECT_EQ(pass->damage_rect, copy->damage_rect); + EXPECT_EQ(pass->damage_rect, copy->damage_rect); EXPECT_EQ(pass->has_transparent_background, copy->has_transparent_background); EXPECT_EQ(0u, copy->quad_list.size()); diff --git a/cc/test/geometry_test_utils.h b/cc/test/geometry_test_utils.h index b743f58..38112a889 100644 --- a/cc/test/geometry_test_utils.h +++ b/cc/test/geometry_test_utils.h @@ -29,33 +29,6 @@ do { \ EXPECT_NEAR((expected).height(), (actual).height(), (abs_error)); \ } while (false) -#define EXPECT_RECT_EQ(expected, actual) \ -do { \ - EXPECT_EQ((expected).x(), (actual).x()); \ - EXPECT_EQ((expected).y(), (actual).y()); \ - EXPECT_EQ((expected).width(), (actual).width()); \ - EXPECT_EQ((expected).height(), (actual).height()); \ -} while (false) - -#define EXPECT_SIZE_EQ(expected, actual) \ -do { \ - EXPECT_EQ((expected).width(), (actual).width()); \ - EXPECT_EQ((expected).height(), (actual).height()); \ -} while (false) - -#define EXPECT_POINT_EQ(expected, actual) \ -do { \ - EXPECT_EQ((expected).x(), (actual).x()); \ - EXPECT_EQ((expected).y(), (actual).y()); \ -} while (false) - -#define EXPECT_POINT3F_EQ(expected, actual) \ -do { \ - EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \ - EXPECT_FLOAT_EQ((expected).y(), (actual).y()); \ - EXPECT_FLOAT_EQ((expected).z(), (actual).z()); \ -} while (false) - #define EXPECT_VECTOR_EQ(expected, actual) \ do { \ EXPECT_EQ((expected).x(), (actual).x()); \ diff --git a/cc/test/layer_tree_json_parser_unittest.cc b/cc/test/layer_tree_json_parser_unittest.cc index 4f9c562..a11d545 100644 --- a/cc/test/layer_tree_json_parser_unittest.cc +++ b/cc/test/layer_tree_json_parser_unittest.cc @@ -27,10 +27,9 @@ bool LayerTreesMatch(LayerImpl* const layer_impl, RETURN_IF_EXPECTATION_FAILS(EXPECT_EQ(layer_impl->children().size(), layer->children().size())); - RETURN_IF_EXPECTATION_FAILS(EXPECT_SIZE_EQ(layer_impl->bounds(), - layer->bounds())); - RETURN_IF_EXPECTATION_FAILS(EXPECT_POINT_EQ(layer_impl->position(), - layer->position())); + RETURN_IF_EXPECTATION_FAILS(EXPECT_EQ(layer_impl->bounds(), layer->bounds())); + RETURN_IF_EXPECTATION_FAILS( + EXPECT_EQ(layer_impl->position(), layer->position())); RETURN_IF_EXPECTATION_FAILS( EXPECT_TRANSFORMATION_MATRIX_EQ(layer_impl->draw_transform(), layer->draw_transform())); diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index 8c02bd3..3e2e792 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -1943,12 +1943,9 @@ TEST_F(LayerTreeHostCommonTest, DrawableContentRectForLayers) { inputs.can_adjust_raster_scales = true; LayerTreeHostCommon::CalculateDrawProperties(&inputs); - EXPECT_RECT_EQ(gfx::Rect(5, 5, 10, 10), - grand_child1->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(15, 15, 5, 5), - grand_child3->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(15, 15, 5, 5), - grand_child3->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(5, 5, 10, 10), grand_child1->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(15, 15, 5, 5), grand_child3->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(15, 15, 5, 5), grand_child3->drawable_content_rect()); EXPECT_TRUE(grand_child4->drawable_content_rect().IsEmpty()); } @@ -2090,12 +2087,12 @@ TEST_F(LayerTreeHostCommonTest, ClipRectIsPropagatedCorrectlyToSurfaces) { // Surfaces are clipped by their parent, but un-affected by the owning layer's // masksToBounds. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 20, 20), - grand_child1->render_surface()->clip_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 20, 20), - grand_child2->render_surface()->clip_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 20, 20), - grand_child3->render_surface()->clip_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 20, 20), + grand_child1->render_surface()->clip_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 20, 20), + grand_child2->render_surface()->clip_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 20, 20), + grand_child3->render_surface()->clip_rect()); } TEST_F(LayerTreeHostCommonTest, AnimationsForRenderSurfaceHierarchy) { @@ -2320,7 +2317,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectForIdentityTransform) { gfx::Rect expected = gfx::Rect(10, 10, 30, 30); gfx::Rect actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); // Case 2: Layer is outside the surface rect. layer_content_rect = gfx::Rect(120, 120, 30, 30); @@ -2333,7 +2330,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectForIdentityTransform) { expected = gfx::Rect(80, 80, 20, 20); actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); } TEST_F(LayerTreeHostCommonTest, VisibleRectForTranslations) { @@ -2350,7 +2347,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectForTranslations) { gfx::Rect expected = gfx::Rect(0, 0, 30, 30); gfx::Rect actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); // Case 2: Layer is outside the surface rect. layer_to_surface_transform.MakeIdentity(); @@ -2365,7 +2362,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectForTranslations) { expected = gfx::Rect(0, 0, 20, 20); actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); } TEST_F(LayerTreeHostCommonTest, VisibleRectFor2DRotations) { @@ -2384,7 +2381,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectFor2DRotations) { gfx::Rect expected = gfx::Rect(0, 0, 30, 30); gfx::Rect actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); // Case 2: Layer is outside the surface rect. layer_to_surface_transform.MakeIdentity(); @@ -2404,7 +2401,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectFor2DRotations) { expected = gfx::Rect(0, 0, 30, 30); actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); // Case 4: The layer is rotated about its top-left corner, and translated // upwards. In surface space, the layer is oriented diagonally, with only the @@ -2417,7 +2414,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectFor2DRotations) { expected = gfx::Rect(15, 0, 15, 30); // Right half of layer bounds. actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); } TEST_F(LayerTreeHostCommonTest, VisibleRectFor3dOrthographicTransform) { @@ -2435,7 +2432,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectFor3dOrthographicTransform) { gfx::Rect expected = gfx::Rect(0, 0, 100, 100); gfx::Rect actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); // Case 2: Orthographic projection of a layer rotated about y-axis by 45 // degrees, but shifted to the side so only the right-half the layer would be @@ -2450,7 +2447,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectFor3dOrthographicTransform) { expected = gfx::Rect(50, 0, 50, 100); // Tight half of the layer. actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); } TEST_F(LayerTreeHostCommonTest, VisibleRectFor3dPerspectiveTransform) { @@ -2478,7 +2475,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectFor3dPerspectiveTransform) { gfx::Rect expected = gfx::Rect(-50, -50, 200, 200); gfx::Rect actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); // Case 2: same projection as before, except that the layer is also translated // to the side, so that only the right half of the layer should be visible. @@ -2495,7 +2492,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectFor3dPerspectiveTransform) { // bounding rect. actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); } TEST_F(LayerTreeHostCommonTest, @@ -2519,7 +2516,7 @@ TEST_F(LayerTreeHostCommonTest, gfx::Rect expected = gfx::Rect(0, 0, 100, 100); gfx::Rect actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); } TEST_F(LayerTreeHostCommonTest, VisibleRectFor3dPerspectiveWhenClippedByW) { @@ -2592,7 +2589,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleRectForPerspectiveUnprojection) { gfx::Rect expected = gfx::Rect(-10, -10, 20, 20); gfx::Rect actual = LayerTreeHostCommon::CalculateVisibleRect( target_surface_rect, layer_content_rect, layer_to_surface_transform); - EXPECT_RECT_EQ(expected, actual); + EXPECT_EQ(expected, actual); } TEST_F(LayerTreeHostCommonTest, DrawableAndVisibleContentRectsForSimpleLayers) { @@ -2642,22 +2639,22 @@ TEST_F(LayerTreeHostCommonTest, DrawableAndVisibleContentRectsForSimpleLayers) { ExecuteCalculateDrawProperties(root.get()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), - root->render_surface()->DrawableContentRect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), + root->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); // Layers that do not draw content should have empty visible_content_rects. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); // layer visible_content_rects are clipped by their target surface. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 25, 25), child2->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 25, 25), child2->visible_content_rect()); EXPECT_TRUE(child3->visible_content_rect().IsEmpty()); // layer drawable_content_rects are not clipped. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child1->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); } TEST_F(LayerTreeHostCommonTest, @@ -2720,24 +2717,22 @@ TEST_F(LayerTreeHostCommonTest, ASSERT_FALSE(child->render_surface()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), - root->render_surface()->DrawableContentRect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), + root->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); // Layers that do not draw content should have empty visible content rects. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), child->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), child->visible_content_rect()); // All grandchild visible content rects should be clipped by child. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), grand_child1->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 25, 25), grand_child2->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), grand_child1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 25, 25), grand_child2->visible_content_rect()); EXPECT_TRUE(grand_child3->visible_content_rect().IsEmpty()); // All grandchild DrawableContentRects should also be clipped by child. - EXPECT_RECT_EQ(gfx::Rect(5, 5, 50, 50), - grand_child1->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(75, 75, 25, 25), - grand_child2->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(5, 5, 50, 50), grand_child1->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(75, 75, 25, 25), grand_child2->drawable_content_rect()); EXPECT_TRUE(grand_child3->drawable_content_rect().IsEmpty()); } @@ -2801,28 +2796,27 @@ TEST_F(LayerTreeHostCommonTest, ASSERT_TRUE(render_surface1->render_surface()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), - root->render_surface()->DrawableContentRect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), + root->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); // Layers that do not draw content should have empty visible content rects. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), - render_surface1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), render_surface1->visible_content_rect()); // An unclipped surface grows its DrawableContentRect to include all drawable // regions of the subtree. - EXPECT_RECT_EQ(gfx::Rect(5, 5, 170, 170), - render_surface1->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(5, 5, 170, 170), + render_surface1->render_surface()->DrawableContentRect()); // All layers that draw content into the unclipped surface are also unclipped. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); } TEST_F(LayerTreeHostCommonTest, @@ -3085,30 +3079,29 @@ TEST_F(LayerTreeHostCommonTest, ASSERT_TRUE(render_surface1->render_surface()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), - root->render_surface()->DrawableContentRect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), + root->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); // Layers that do not draw content should have empty visible content rects. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), - render_surface1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), render_surface1->visible_content_rect()); // A clipped surface grows its DrawableContentRect to include all drawable // regions of the subtree, but also gets clamped by the ancestor's clip. - EXPECT_RECT_EQ(gfx::Rect(5, 5, 95, 95), - render_surface1->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(5, 5, 95, 95), + render_surface1->render_surface()->DrawableContentRect()); // All layers that draw content into the surface have their visible content // rect clipped by the surface clip rect. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 25, 25), child2->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 25, 25), child2->visible_content_rect()); EXPECT_TRUE(child3->visible_content_rect().IsEmpty()); // But the DrawableContentRects are unclipped. - EXPECT_RECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); } TEST_F(LayerTreeHostCommonTest, @@ -3184,37 +3177,35 @@ TEST_F(LayerTreeHostCommonTest, ASSERT_TRUE(render_surface1->render_surface()); ASSERT_TRUE(render_surface2->render_surface()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), - root->render_surface()->DrawableContentRect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), + root->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); // Layers that do not draw content should have empty visible content rects. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), - render_surface1->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), - render_surface2->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), render_surface1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), render_surface2->visible_content_rect()); // A clipped surface grows its DrawableContentRect to include all drawable // regions of the subtree, but also gets clamped by the ancestor's clip. - EXPECT_RECT_EQ(gfx::Rect(5, 5, 95, 95), - render_surface1->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(5, 5, 95, 95), + render_surface1->render_surface()->DrawableContentRect()); // render_surface1 lives in the "unclipped universe" of render_surface1, and // is only implicitly clipped by render_surface1's content rect. So, // render_surface2 grows to enclose all drawable content of its subtree. - EXPECT_RECT_EQ(gfx::Rect(5, 5, 170, 170), - render_surface2->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(5, 5, 170, 170), + render_surface2->render_surface()->DrawableContentRect()); // All layers that draw content into render_surface2 think they are unclipped. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visible_content_rect()); // DrawableContentRects are also unclipped. - EXPECT_RECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(5, 5, 50, 50), child1->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(75, 75, 50, 50), child2->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); } TEST_F(LayerTreeHostCommonTest, @@ -3262,14 +3253,13 @@ TEST_F(LayerTreeHostCommonTest, ASSERT_TRUE(render_surface1->render_surface()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), - root->render_surface()->DrawableContentRect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), + root->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), root->drawable_content_rect()); // Layers that do not draw content should have empty visible content rects. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), - render_surface1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), render_surface1->visible_content_rect()); // The unclipped surface grows its DrawableContentRect to include all drawable // regions of the subtree. @@ -3279,13 +3269,12 @@ TEST_F(LayerTreeHostCommonTest, 50 - diagonal_radius, diagonal_radius * 2, diagonal_radius * 2); - EXPECT_RECT_EQ(expected_surface_drawable_content, - render_surface1->render_surface()->DrawableContentRect()); + EXPECT_EQ(expected_surface_drawable_content, + render_surface1->render_surface()->DrawableContentRect()); // All layers that draw content into the unclipped surface are also unclipped. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); - EXPECT_RECT_EQ(expected_surface_drawable_content, - child1->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); + EXPECT_EQ(expected_surface_drawable_content, child1->drawable_content_rect()); } TEST_F(LayerTreeHostCommonTest, @@ -3344,18 +3333,18 @@ TEST_F(LayerTreeHostCommonTest, diagonal_radius * 2); gfx::Rect expected_surface_drawable_content = gfx::IntersectRects(unclipped_surface_content, gfx::Rect(0, 0, 50, 50)); - EXPECT_RECT_EQ(expected_surface_drawable_content, - render_surface1->render_surface()->DrawableContentRect()); + EXPECT_EQ(expected_surface_drawable_content, + render_surface1->render_surface()->DrawableContentRect()); // On the clipped surface, only a quarter of the child1 is visible, but when // rotating it back to child1's content space, the actual enclosing rect ends // up covering the full left half of child1. // // Given the floating point math, this number is a little bit fuzzy. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 26, 50), child1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 26, 50), child1->visible_content_rect()); // The child's DrawableContentRect is unclipped. - EXPECT_RECT_EQ(unclipped_surface_content, child1->drawable_content_rect()); + EXPECT_EQ(unclipped_surface_content, child1->drawable_content_rect()); } TEST_F(LayerTreeHostCommonTest, DrawableAndVisibleContentRectsInHighDPI) { @@ -3434,35 +3423,31 @@ TEST_F(LayerTreeHostCommonTest, DrawableAndVisibleContentRectsInHighDPI) { // drawable_content_rects for all layers and surfaces are scaled by // device_scale_factor. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 200, 200), - root->render_surface()->DrawableContentRect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 200, 200), root->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(10, 10, 190, 190), - render_surface1->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(0, 0, 200, 200), + root->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(0, 0, 200, 200), root->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(10, 10, 190, 190), + render_surface1->render_surface()->DrawableContentRect()); // render_surface2 lives in the "unclipped universe" of render_surface1, and // is only implicitly clipped by render_surface1. - EXPECT_RECT_EQ(gfx::Rect(10, 10, 350, 350), - render_surface2->render_surface()->DrawableContentRect()); + EXPECT_EQ(gfx::Rect(10, 10, 350, 350), + render_surface2->render_surface()->DrawableContentRect()); - EXPECT_RECT_EQ(gfx::Rect(10, 10, 100, 100), child1->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(150, 150, 100, 100), - child2->drawable_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(250, 250, 100, 100), - child3->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(10, 10, 100, 100), child1->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(150, 150, 100, 100), child2->drawable_content_rect()); + EXPECT_EQ(gfx::Rect(250, 250, 100, 100), child3->drawable_content_rect()); // The root layer does not actually draw content of its own. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), root->visible_content_rect()); // All layer visible content rects are not expressed in content space of each // layer, so they are not scaled by the device_scale_factor. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 3, 4), - render_surface1->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 7, 13), - render_surface2->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visible_content_rect()); - EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 3, 4), render_surface1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 7, 13), render_surface2->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child1->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child2->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 50, 50), child3->visible_content_rect()); } TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithoutPreserves3d) { @@ -5458,8 +5443,8 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceTransformsInHighDPI) { EXPECT_TRANSFORMATION_MATRIX_EQ( child->screen_space_transform(), duplicate_child_non_owner->screen_space_transform()); - EXPECT_RECT_EQ(child->drawable_content_rect(), - duplicate_child_non_owner->drawable_content_rect()); + EXPECT_EQ(child->drawable_content_rect(), + duplicate_child_non_owner->drawable_content_rect()); EXPECT_EQ(child->content_bounds(), duplicate_child_non_owner->content_bounds()); diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index cf5ec1a..4a41d2a 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -5390,7 +5390,7 @@ class LayerTreeHostImplTestWithDelegatingRenderer // Verify the damage rect for the root render pass. const RenderPass* root_render_pass = frame.render_passes.back(); - EXPECT_RECT_EQ(expected_damage, root_render_pass->damage_rect); + EXPECT_EQ(expected_damage, root_render_pass->damage_rect); // Verify the root and child layers' quads are generated and not being // culled. @@ -5398,13 +5398,13 @@ class LayerTreeHostImplTestWithDelegatingRenderer LayerImpl* child = host_impl_->active_tree()->root_layer()->children()[0]; gfx::RectF expected_child_visible_rect(child->content_bounds()); - EXPECT_RECT_EQ(expected_child_visible_rect, - root_render_pass->quad_list.front()->visible_rect); + EXPECT_EQ(expected_child_visible_rect, + root_render_pass->quad_list.front()->visible_rect); LayerImpl* root = host_impl_->active_tree()->root_layer(); gfx::RectF expected_root_visible_rect(root->content_bounds()); - EXPECT_RECT_EQ(expected_root_visible_rect, - root_render_pass->quad_list.ElementAt(1)->visible_rect); + EXPECT_EQ(expected_root_visible_rect, + root_render_pass->quad_list.ElementAt(1)->visible_rect); } host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 60c5675..44dd9df 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -444,7 +444,7 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest { if (!num_draws_) { // If this is the first frame, expect full frame damage. - EXPECT_RECT_EQ(root_damage_rect, gfx::Rect(bounds_)); + EXPECT_EQ(root_damage_rect, gfx::Rect(bounds_)); } else { // Check that invalid_rect_ is indeed repainted. EXPECT_TRUE(root_damage_rect.Contains(invalid_rect_)); @@ -626,17 +626,17 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest { switch (num_draws_) { case 0: - EXPECT_RECT_EQ(gfx::Rect(bounds_), root_damage_rect); + EXPECT_EQ(gfx::Rect(bounds_), root_damage_rect); break; case 1: case 2: - EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), root_damage_rect); + EXPECT_EQ(gfx::Rect(0, 0, 0, 0), root_damage_rect); break; case 3: - EXPECT_RECT_EQ(invalid_rect_, root_damage_rect); + EXPECT_EQ(invalid_rect_, root_damage_rect); break; case 4: - EXPECT_RECT_EQ(gfx::Rect(bounds_), root_damage_rect); + EXPECT_EQ(gfx::Rect(bounds_), root_damage_rect); break; default: NOTREACHED(); @@ -738,12 +738,12 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { // box. switch (host_impl->active_tree()->source_frame_number()) { case 0: - EXPECT_RECT_EQ(gfx::Rect(root_layer_->bounds()), root_damage_rect); + EXPECT_EQ(gfx::Rect(root_layer_->bounds()), root_damage_rect); break; case 1: case 2: case 3: - EXPECT_RECT_EQ(gfx::Rect(child_layer_->bounds()), root_damage_rect); + EXPECT_EQ(gfx::Rect(child_layer_->bounds()), root_damage_rect); break; default: NOTREACHED(); @@ -1271,8 +1271,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers ASSERT_EQ(2u, root->render_surface()->layer_list().size()); // The root render surface is the size of the viewport. - EXPECT_RECT_EQ(gfx::Rect(0, 0, 60, 60), - root->render_surface()->content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 60, 60), root->render_surface()->content_rect()); // The max tiling scale of the child should be scaled. EXPECT_FLOAT_EQ(1.5f, child->MaximumTilingContentsScale()); @@ -2645,10 +2644,10 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents num_commits_++; if (num_commits_ == 1) { LayerImpl* root_layer = host_impl->active_tree()->root_layer(); - EXPECT_SIZE_EQ(gfx::Size(1, 1), root_layer->bounds()); + EXPECT_EQ(gfx::Size(1, 1), root_layer->bounds()); } else { LayerImpl* root_layer = host_impl->active_tree()->root_layer(); - EXPECT_SIZE_EQ(gfx::Size(2, 2), root_layer->bounds()); + EXPECT_EQ(gfx::Size(2, 2), root_layer->bounds()); EndTest(); } } @@ -2771,7 +2770,7 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { CHECK_EQ(DrawQuad::IO_SURFACE_CONTENT, quad->material); const IOSurfaceDrawQuad* io_surface_draw_quad = IOSurfaceDrawQuad::MaterialCast(quad); - EXPECT_SIZE_EQ(io_surface_size_, io_surface_draw_quad->io_surface_size); + EXPECT_EQ(io_surface_size_, io_surface_draw_quad->io_surface_size); EXPECT_NE(0u, io_surface_draw_quad->io_surface_resource_id); EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_RECTANGLE_ARB), resource_provider->TargetForTesting( diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index 2131d4c..78d72de 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc @@ -463,7 +463,7 @@ TEST_F(LayerTreeImplTest, HitTestingForSingleLayerWithScaledContents) { // its layout size is 50x50, positioned at 25x25. LayerImpl* test_layer = host_impl().active_tree()->root_layer()->children()[0]; - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), test_layer->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), test_layer->visible_content_rect()); ASSERT_EQ(1u, RenderSurfaceLayerList().size()); ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size()); @@ -1697,7 +1697,7 @@ TEST_F(LayerTreeImplTest, // its layout size is 50x50, positioned at 25x25. LayerImpl* test_layer = host_impl().active_tree()->root_layer()->children()[0]; - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), test_layer->visible_content_rect()); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), test_layer->visible_content_rect()); ASSERT_EQ(1u, RenderSurfaceLayerList().size()); ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size()); @@ -1812,8 +1812,8 @@ TEST_F(LayerTreeImplTest, ASSERT_EQ(1u, root_layer()->render_surface()->layer_list().size()); // Check whether the child layer fits into the root after scaled. - EXPECT_RECT_EQ(gfx::Rect(test_layer->content_bounds()), - test_layer->visible_content_rect()); + EXPECT_EQ(gfx::Rect(test_layer->content_bounds()), + test_layer->visible_content_rect()); // Hit checking for a point outside the layer should return a null pointer // (the root layer does not draw content, so it will not be tested either). |