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

Side by Side Diff: Source/core/paint/DisplayItemListPaintTest.cpp

Issue 1157653005: Move use of DisplayItemList's vector behind an explicit DisplayItems interface. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: DisplayItems must be noncopyable (Windows build fix) 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "platform/graphics/paint/DisplayItemList.h" 6 #include "platform/graphics/paint/DisplayItemList.h"
7 7
8 #include "core/layout/LayoutTestHelper.h" 8 #include "core/layout/LayoutTestHelper.h"
9 #include "core/layout/LayoutText.h" 9 #include "core/layout/LayoutText.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
(...skipping 13 matching lines...) Expand all
24 namespace blink { 24 namespace blink {
25 25
26 class DisplayItemListPaintTest : public RenderingTest { 26 class DisplayItemListPaintTest : public RenderingTest {
27 public: 27 public:
28 DisplayItemListPaintTest() 28 DisplayItemListPaintTest()
29 : m_layoutView(nullptr) { } 29 : m_layoutView(nullptr) { }
30 30
31 protected: 31 protected:
32 LayoutView& layoutView() { return *m_layoutView; } 32 LayoutView& layoutView() { return *m_layoutView; }
33 DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graph icsLayerBacking()->displayItemList(); } 33 DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graph icsLayerBacking()->displayItemList(); }
34 const Vector<OwnPtr<DisplayItem>>& newPaintListBeforeUpdate() { return rootD isplayItemList().m_newDisplayItems; } 34 const DisplayItems& newPaintListBeforeUpdate() { return rootDisplayItemList( ).m_newDisplayItems; }
35 35
36 private: 36 private:
37 virtual void SetUp() override 37 virtual void SetUp() override
38 { 38 {
39 RuntimeEnabledFeatures::setSlimmingPaintEnabled(true); 39 RuntimeEnabledFeatures::setSlimmingPaintEnabled(true);
40 40
41 RenderingTest::SetUp(); 41 RenderingTest::SetUp();
42 enableCompositing(); 42 enableCompositing();
43 43
44 m_layoutView = document().view()->layoutView(); 44 m_layoutView = document().view()->layoutView();
(...skipping 24 matching lines...) Expand all
69 #define TRACE_DISPLAY_ITEMS(i, expected, actual) 69 #define TRACE_DISPLAY_ITEMS(i, expected, actual)
70 #endif 70 #endif
71 71
72 #define EXPECT_DISPLAY_LIST(actual, expectedSize, ...) \ 72 #define EXPECT_DISPLAY_LIST(actual, expectedSize, ...) \
73 do { \ 73 do { \
74 EXPECT_EQ((size_t)expectedSize, actual.size()); \ 74 EXPECT_EQ((size_t)expectedSize, actual.size()); \
75 if (expectedSize != actual.size()) \ 75 if (expectedSize != actual.size()) \
76 break; \ 76 break; \
77 const TestDisplayItem expected[] = { __VA_ARGS__ }; \ 77 const TestDisplayItem expected[] = { __VA_ARGS__ }; \
78 for (size_t index = 0; index < std::min<size_t>(actual.size(), expectedS ize); index++) { \ 78 for (size_t index = 0; index < std::min<size_t>(actual.size(), expectedS ize); index++) { \
79 TRACE_DISPLAY_ITEMS(index, expected[index], *actual[index]); \ 79 TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \
80 EXPECT_EQ(expected[index].client(), actual[index]->client()); \ 80 EXPECT_EQ(expected[index].client(), actual[index].client()); \
81 EXPECT_EQ(expected[index].type(), actual[index]->type()); \ 81 EXPECT_EQ(expected[index].type(), actual[index].type()); \
82 } \ 82 } \
83 } while (false); 83 } while (false);
84 84
85 TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret) 85 TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret)
86 { 86 {
87 setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'> XYZ</div>"); 87 setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'> XYZ</div>");
88 document().page()->focusController().setActive(true); 88 document().page()->focusController().setActive(true);
89 document().page()->focusController().setFocused(true); 89 document().page()->focusController().setFocused(true);
90 LayoutView& layoutView = *document().layoutView(); 90 LayoutView& layoutView = *document().layoutView();
91 DeprecatedPaintLayer& rootLayer = *layoutView.layer(); 91 DeprecatedPaintLayer& rootLayer = *layoutView.layer();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); 150 InlineTextBox& newFirstTextBox = *newText.firstTextBox();
151 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); 151 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
152 152
153 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3, 153 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
154 TestDisplayItem(htmlObject, DisplayItem::BoxDecorationBackground), 154 TestDisplayItem(htmlObject, DisplayItem::BoxDecorationBackground),
155 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa intPhaseForeground)), 155 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa intPhaseForeground)),
156 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground))); 156 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain tPhaseForeground)));
157 } 157 }
158 158
159 } // namespace blink 159 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/paint/LayerClipRecorderTest.cpp » ('j') | Source/platform/graphics/paint/DisplayItems.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698