Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Unified Diff: third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp

Issue 1415143005: Preparation for enabling slimming paint synchronized painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698