Index: third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp |
index 48187b14f3f262ee9eda784dc757de14dce7ec5d..42ce32e27f4752af35fde9d592ccbdc6c1f0670e 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp |
@@ -9,83 +9,13 @@ |
#include "core/layout/line/InlineTextBox.h" |
#include "core/page/FocusController.h" |
#include "core/paint/LayoutObjectDrawingRecorder.h" |
-#include "core/paint/PaintLayerPainter.h" |
-#include "platform/graphics/GraphicsContext.h" |
#include "platform/graphics/paint/DrawingDisplayItem.h" |
namespace blink { |
-TEST_F(PaintControllerPaintTest, FullDocumentPaintingWithCaret) |
-{ |
- setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>XYZ</div>"); |
- document().page()->focusController().setActive(true); |
- document().page()->focusController().setFocused(true); |
- PaintLayer& rootLayer = *layoutView().layer(); |
- Element& div = *toElement(document().body()->firstChild()); |
- LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObject(); |
- InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject())->firstTextBox(); |
- |
- GraphicsContext context(rootPaintController()); |
- PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize()); |
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases); |
- rootPaintController().commitNewDisplayItems(); |
- |
- EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 2, |
- TestDisplayItem(layoutView(), backgroundType), |
- TestDisplayItem(textInlineBox, foregroundType)); |
- |
- div.focus(); |
- document().view()->updateAllLifecyclePhases(); |
- EXPECT_TRUE(rootPaintController().clientCacheIsValid(layoutView().displayItemClient())); |
- EXPECT_FALSE(rootPaintController().clientCacheIsValid(divLayoutObject.displayItemClient())); |
- EXPECT_TRUE(rootPaintController().clientCacheIsValid(textInlineBox.displayItemClient())); |
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases); |
- rootPaintController().commitNewDisplayItems(); |
- |
- EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 3, |
- TestDisplayItem(layoutView(), backgroundType), |
- TestDisplayItem(textInlineBox, foregroundType), |
- TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New! |
-} |
- |
-TEST_F(PaintControllerPaintTest, InlineRelayout) |
-{ |
- setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA BBBBBBBBBB</div>"); |
- PaintLayer& rootLayer = *layoutView().layer(); |
- Element& div = *toElement(document().body()->firstChild()); |
- LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layoutObject()); |
- LayoutText& text = *toLayoutText(divBlock.firstChild()); |
- InlineTextBox& firstTextBox = *text.firstTextBox(); |
- DisplayItemClient firstTextBoxDisplayItemClient = firstTextBox.displayItemClient(); |
- |
- GraphicsContext context(rootPaintController()); |
- PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize()); |
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases); |
- rootPaintController().commitNewDisplayItems(); |
- |
- EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 2, |
- TestDisplayItem(layoutView(), backgroundType), |
- TestDisplayItem(firstTextBox, foregroundType)); |
- |
- div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); |
- document().view()->updateAllLifecyclePhases(); |
- EXPECT_TRUE(rootPaintController().clientCacheIsValid(layoutView().displayItemClient())); |
- EXPECT_FALSE(rootPaintController().clientCacheIsValid(divBlock.displayItemClient())); |
- EXPECT_FALSE(rootPaintController().clientCacheIsValid(firstTextBoxDisplayItemClient)); |
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases); |
- rootPaintController().commitNewDisplayItems(); |
- |
- LayoutText& newText = *toLayoutText(divBlock.firstChild()); |
- InlineTextBox& newFirstTextBox = *newText.firstTextBox(); |
- InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); |
- |
- EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 3, |
- TestDisplayItem(layoutView(), backgroundType), |
- TestDisplayItem(newFirstTextBox, foregroundType), |
- TestDisplayItem(secondTextBox, foregroundType)); |
-} |
+INSTANTIATE_TEST_CASE_P(All, PaintControllerPaintTestForSlimmingPaintV1AndV2, ::testing::Bool()); |
-TEST_F(PaintControllerPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret) |
+TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, FullDocumentPaintingWithCaret) |
{ |
setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>XYZ</div>"); |
document().page()->focusController().setActive(true); |
@@ -114,7 +44,7 @@ TEST_F(PaintControllerPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret |
TestDisplayItem(rootLayer, endSubsequenceType)); |
} |
-TEST_F(PaintControllerPaintTestForSlimmingPaintV2, InlineRelayout) |
+TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, InlineRelayout) |
{ |
setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA BBBBBBBBBB</div>"); |
PaintLayer& rootLayer = *layoutView().layer(); |