Index: third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp |
diff --git a/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp b/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp |
index a1f912016c7cbe75b5595bcba079ff9f261d6563..6e2cdfda91c0d7ffcf4e3005af0b3aa635d83fd4 100644 |
--- a/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp |
+++ b/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp |
@@ -6,14 +6,14 @@ |
#include "core/paint/PaintControllerPaintTest.h" |
#include "core/paint/PaintLayerPainter.h" |
-#include "platform/graphics/GraphicsContext.h" |
namespace blink { |
-using TableCellPainterTest = PaintControllerPaintTest; |
+using TableCellPainterTest = PaintControllerPaintTestForSlimmingPaintV1AndV2; |
-// TODO(wangxianzhu): Create a version for slimming paint v2 when it supports interest rect |
-TEST_F(TableCellPainterTest, TableCellBackgroundInterestRect) |
+INSTANTIATE_TEST_CASE_P(All, TableCellPainterTest, ::testing::Bool()); |
+ |
+TEST_P(TableCellPainterTest, TableCellBackgroundInterestRect) |
{ |
setBodyInnerHTML( |
"<style>" |
@@ -26,27 +26,30 @@ TEST_F(TableCellPainterTest, TableCellBackgroundInterestRect) |
" <tr><td id='cell2'></td></tr>" |
"</table>"); |
+ rootPaintController().invalidateAll(); |
+ |
LayoutView& layoutView = *document().layoutView(); |
PaintLayer& rootLayer = *layoutView.layer(); |
LayoutObject& cell1 = *document().getElementById("cell1")->layoutObject(); |
LayoutObject& cell2 = *document().getElementById("cell2")->layoutObject(); |
- GraphicsContext context(rootPaintController()); |
- PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 200, 200), GlobalPaintNormalPhase, LayoutSize()); |
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases); |
- rootPaintController().commitNewDisplayItems(); |
+ LayoutRect interestRect(0, 0, 200, 200); |
+ document().view()->updateAllLifecyclePhases(&interestRect); |
- EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 2, |
+ EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 4, |
TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(cell1, DisplayItem::TableCellBackgroundFromRow)); |
+ TestDisplayItem(rootLayer, subsequenceType), |
+ TestDisplayItem(cell1, DisplayItem::TableCellBackgroundFromRow), |
+ TestDisplayItem(rootLayer, endSubsequenceType)); |
- PaintLayerPaintingInfo paintingInfo1(&rootLayer, LayoutRect(0, 300, 200, 200), GlobalPaintNormalPhase, LayoutSize()); |
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo1, PaintLayerPaintingCompositingAllPhases); |
- rootPaintController().commitNewDisplayItems(); |
+ interestRect = LayoutRect(0, 300, 200, 200); |
+ document().view()->updateAllLifecyclePhases(&interestRect); |
- EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 2, |
+ EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 4, |
TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
- TestDisplayItem(cell2, DisplayItem::TableCellBackgroundFromRow)); |
+ TestDisplayItem(rootLayer, subsequenceType), |
+ TestDisplayItem(cell2, DisplayItem::TableCellBackgroundFromRow), |
+ TestDisplayItem(rootLayer, endSubsequenceType)); |
} |
} // namespace blink |