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

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

Issue 1401363003: Rename DisplayItemList to PaintController (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/DisplayItemListPaintTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp b/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp
deleted file mode 100644
index 2efebc754dbf0e4f34c452761586bef38996bfef..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "core/paint/DisplayItemListPaintTest.h"
-
-#include "core/layout/LayoutText.h"
-#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(DisplayItemListPaintTest, 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(&rootDisplayItemList());
- PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize());
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
- rootDisplayItemList().commitNewDisplayItems();
-
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
- TestDisplayItem(layoutView(), backgroundType),
- TestDisplayItem(textInlineBox, foregroundType));
-
- div.focus();
- document().view()->updateAllLifecyclePhases();
- EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView().displayItemClient()));
- EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divLayoutObject.displayItemClient()));
- EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(textInlineBox.displayItemClient()));
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
- rootDisplayItemList().commitNewDisplayItems();
-
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
- TestDisplayItem(layoutView(), backgroundType),
- TestDisplayItem(textInlineBox, foregroundType),
- TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New!
-}
-
-TEST_F(DisplayItemListPaintTest, 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(&rootDisplayItemList());
- PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize());
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
- rootDisplayItemList().commitNewDisplayItems();
-
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
- TestDisplayItem(layoutView(), backgroundType),
- TestDisplayItem(firstTextBox, foregroundType));
-
- div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
- document().view()->updateAllLifecyclePhases();
- EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView().displayItemClient()));
- EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divBlock.displayItemClient()));
- EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(firstTextBoxDisplayItemClient));
- PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
- rootDisplayItemList().commitNewDisplayItems();
-
- LayoutText& newText = *toLayoutText(divBlock.firstChild());
- InlineTextBox& newFirstTextBox = *newText.firstTextBox();
- InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
-
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
- TestDisplayItem(layoutView(), backgroundType),
- TestDisplayItem(newFirstTextBox, foregroundType),
- TestDisplayItem(secondTextBox, foregroundType));
-}
-
-TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, 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();
-
- document().view()->updateAllLifecyclePhases();
-
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 4,
- TestDisplayItem(layoutView(), backgroundType),
- TestDisplayItem(rootLayer, subsequenceType),
- TestDisplayItem(textInlineBox, foregroundType),
- TestDisplayItem(rootLayer, endSubsequenceType));
-
- div.focus();
- document().view()->updateAllLifecyclePhases();
-
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 5,
- TestDisplayItem(layoutView(), backgroundType),
- TestDisplayItem(rootLayer, subsequenceType),
- TestDisplayItem(textInlineBox, foregroundType),
- TestDisplayItem(divLayoutObject, DisplayItem::Caret), // New!
- TestDisplayItem(rootLayer, endSubsequenceType));
-}
-
-TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, 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();
-
- document().view()->updateAllLifecyclePhases();
-
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 4,
- TestDisplayItem(layoutView(), backgroundType),
- TestDisplayItem(rootLayer, subsequenceType),
- TestDisplayItem(firstTextBox, foregroundType),
- TestDisplayItem(rootLayer, endSubsequenceType));
-
- div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
- document().view()->updateAllLifecyclePhases();
-
- LayoutText& newText = *toLayoutText(divBlock.firstChild());
- InlineTextBox& newFirstTextBox = *newText.firstTextBox();
- InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
-
- EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 5,
- TestDisplayItem(layoutView(), backgroundType),
- TestDisplayItem(rootLayer, subsequenceType),
- TestDisplayItem(newFirstTextBox, foregroundType),
- TestDisplayItem(secondTextBox, foregroundType),
- TestDisplayItem(rootLayer, endSubsequenceType));
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698