Index: chrome/renderer/paint_aggregator_unittest.cc |
=================================================================== |
--- chrome/renderer/paint_aggregator_unittest.cc (revision 68349) |
+++ chrome/renderer/paint_aggregator_unittest.cc (working copy) |
@@ -26,8 +26,8 @@ |
TEST(PaintAggregator, DoubleDisjointInvalidation) { |
PaintAggregator greg; |
- gfx::Rect r1(2, 4, 2, 4); |
- gfx::Rect r2(4, 2, 4, 2); |
+ gfx::Rect r1(2, 4, 2, 40); |
+ gfx::Rect r2(4, 2, 40, 2); |
greg.InvalidateRect(r1); |
greg.InvalidateRect(r2); |
@@ -36,11 +36,29 @@ |
EXPECT_TRUE(greg.HasPendingUpdate()); |
EXPECT_TRUE(greg.GetPendingUpdate().scroll_rect.IsEmpty()); |
- ASSERT_EQ(2U, greg.GetPendingUpdate().paint_rects.size()); |
+ EXPECT_EQ(2U, greg.GetPendingUpdate().paint_rects.size()); |
EXPECT_EQ(expected_bounds, greg.GetPendingUpdate().GetPaintBounds()); |
} |
+TEST(PaintAggregator, DisjointInvalidationsCombined) { |
+ PaintAggregator greg; |
+ |
+ gfx::Rect r1(2, 4, 2, 2); |
+ gfx::Rect r2(4, 2, 2, 2); |
+ |
+ greg.InvalidateRect(r1); |
+ greg.InvalidateRect(r2); |
+ |
+ gfx::Rect expected_bounds = r1.Union(r2); |
+ |
+ EXPECT_TRUE(greg.HasPendingUpdate()); |
+ EXPECT_TRUE(greg.GetPendingUpdate().scroll_rect.IsEmpty()); |
+ ASSERT_EQ(1U, greg.GetPendingUpdate().paint_rects.size()); |
+ |
+ EXPECT_EQ(expected_bounds, greg.GetPendingUpdate().paint_rects[0]); |
+} |
+ |
TEST(PaintAggregator, SingleScroll) { |
PaintAggregator greg; |