summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
authorhush <hush@chromium.org>2014-12-04 14:37:32 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-04 22:38:02 +0000
commit6b61421f5b702f90617ffeff3ed83ab044c55ad9 (patch)
tree58594f58c441c2f7675be1bd42b2e90ee4c0f802 /cc/trees
parent258cddfdb22627e42793771dc3a01f5b1cb1cc07 (diff)
downloadchromium_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/trees')
-rw-r--r--cc/trees/layer_tree_host_common_unittest.cc239
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc10
-rw-r--r--cc/trees/layer_tree_host_unittest.cc23
-rw-r--r--cc/trees/layer_tree_impl_unittest.cc8
4 files changed, 132 insertions, 148 deletions
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).