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

Unified Diff: Source/core/paint/DisplayItemListPaintTest.cpp

Issue 1145993002: Refactor root element background painting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase, adding back TestExpectation Created 5 years, 6 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
« no previous file with comments | « Source/core/paint/BoxPainter.cpp ('k') | Source/core/paint/FrameSetPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DisplayItemListPaintTest.cpp
diff --git a/Source/core/paint/DisplayItemListPaintTest.cpp b/Source/core/paint/DisplayItemListPaintTest.cpp
index 08843ac49d5da69c012c59e621ac7c248497c5a0..4ccac96c24c32f3dfa60ceb578a338fee83cd637 100644
--- a/Source/core/paint/DisplayItemListPaintTest.cpp
+++ b/Source/core/paint/DisplayItemListPaintTest.cpp
@@ -91,7 +91,6 @@ TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret)
document().page()->focusController().setFocused(true);
LayoutView& layoutView = *document().layoutView();
DeprecatedPaintLayer& rootLayer = *layoutView.layer();
- LayoutObject& htmlLayoutObject = *document().documentElement()->layoutObject();
Element& div = *toElement(document().body()->firstChild());
LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObject();
InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject())->firstTextBox();
@@ -102,19 +101,19 @@ TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret)
rootDisplayItemList().commitNewDisplayItems();
EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
- TestDisplayItem(htmlLayoutObject, DisplayItem::BoxDecorationBackground),
+ TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
div.focus();
document().view()->updateLayoutAndStyleForPainting();
- EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(htmlLayoutObject.displayItemClient()));
+ EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView.displayItemClient()));
EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divLayoutObject.displayItemClient()));
EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(textInlineBox.displayItemClient()));
DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
rootDisplayItemList().commitNewDisplayItems();
EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
- TestDisplayItem(htmlLayoutObject, DisplayItem::BoxDecorationBackground),
+ TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
TestDisplayItem(textInlineBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)),
TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New!
}
@@ -124,7 +123,6 @@ TEST_F(DisplayItemListPaintTest, InlineRelayout)
setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA BBBBBBBBBB</div>");
LayoutView& layoutView = *document().layoutView();
DeprecatedPaintLayer& rootLayer = *layoutView.layer();
- LayoutObject& htmlObject = *document().documentElement()->layoutObject();
Element& div = *toElement(document().body()->firstChild());
LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layoutObject());
LayoutText& text = *toLayoutText(divBlock.firstChild());
@@ -137,12 +135,12 @@ TEST_F(DisplayItemListPaintTest, InlineRelayout)
rootDisplayItemList().commitNewDisplayItems();
EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
- TestDisplayItem(htmlObject, DisplayItem::BoxDecorationBackground),
+ TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
TestDisplayItem(firstTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
document().view()->updateLayoutAndStyleForPainting();
- EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(htmlObject.displayItemClient()));
+ EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView.displayItemClient()));
EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divBlock.displayItemClient()));
EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(firstTextBoxDisplayItemClient));
DeprecatedPaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
@@ -153,7 +151,7 @@ TEST_F(DisplayItemListPaintTest, InlineRelayout)
InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
- TestDisplayItem(htmlObject, DisplayItem::BoxDecorationBackground),
+ TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)),
TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
}
« no previous file with comments | « Source/core/paint/BoxPainter.cpp ('k') | Source/core/paint/FrameSetPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698