Chromium Code Reviews| Index: cc/resources/picture_layer_tiling_unittest.cc |
| diff --git a/cc/resources/picture_layer_tiling_unittest.cc b/cc/resources/picture_layer_tiling_unittest.cc |
| index 230e31dd1aa1fbd68575e478abad7259740e4848..5999ecd55e7b52b6005dc2faebb323de24e74a52 100644 |
| --- a/cc/resources/picture_layer_tiling_unittest.cc |
| +++ b/cc/resources/picture_layer_tiling_unittest.cc |
| @@ -591,7 +591,7 @@ TEST(PictureLayerTilingTest, SkewportLimits) { |
| EXPECT_EQ(350, expand_skewport.height()); |
| EXPECT_TRUE(expand_skewport.Contains(gfx::Rect(-50, -50, 200, 200))); |
| - // Expand the viewport past the limit. |
| + // Expand the viewport past the limit in all directions. |
| gfx::Rect big_expand_skewport = |
| tiling->ComputeSkewport(1.5, gfx::Rect(-500, -500, 1500, 1500)); |
| @@ -600,6 +600,23 @@ TEST(PictureLayerTilingTest, SkewportLimits) { |
| EXPECT_EQ(1650, big_expand_skewport.width()); |
| EXPECT_EQ(1650, big_expand_skewport.height()); |
| EXPECT_TRUE(big_expand_skewport.Contains(gfx::Rect(-500, -500, 1500, 1500))); |
| + |
| + // Shrink the skewport in all directions. |
|
enne (OOO)
2015/03/18 23:08:36
Just added this for good measure.
|
| + gfx::Rect shrink_viewport = |
| + tiling->ComputeSkewport(1.5, gfx::Rect(0, 0, 100, 100)); |
| + EXPECT_EQ(0, shrink_viewport.x()); |
| + EXPECT_EQ(0, shrink_viewport.y()); |
| + EXPECT_EQ(100, shrink_viewport.width()); |
| + EXPECT_EQ(100, shrink_viewport.height()); |
| + |
| + // Move the skewport really far in one direction. |
| + gfx::Rect move_skewport_far = |
| + tiling->ComputeSkewport(1.5, gfx::Rect(0, 5000, 100, 100)); |
| + EXPECT_EQ(0, move_skewport_far.x()); |
| + EXPECT_EQ(5000, move_skewport_far.y()); |
| + EXPECT_EQ(100, move_skewport_far.width()); |
| + EXPECT_EQ(175, move_skewport_far.height()); |
|
enne (OOO)
2015/03/18 23:08:36
Before the patch, this is 100.
vmpstr
2015/03/18 23:11:51
Nice!
|
| + EXPECT_TRUE(move_skewport_far.Contains(gfx::Rect(0, 5000, 100, 100))); |
| } |
| TEST(PictureLayerTilingTest, ComputeSkewport) { |