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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp

Issue 2566223003: RootLayerScrolling: update PaintControllerPaintTest expectations. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "core/paint/PaintControllerPaintTest.h" 5 #include "core/paint/PaintControllerPaintTest.h"
6 6
7 #include "core/editing/FrameCaret.h" 7 #include "core/editing/FrameCaret.h"
8 #include "core/editing/FrameSelection.h" 8 #include "core/editing/FrameSelection.h"
9 #include "core/layout/LayoutText.h" 9 #include "core/layout/LayoutText.h"
10 #include "core/layout/line/InlineTextBox.h" 10 #include "core/layout/line/InlineTextBox.h"
(...skipping 14 matching lines...) Expand all
25 FullDocumentPaintingWithCaret) { 25 FullDocumentPaintingWithCaret) {
26 setBodyInnerHTML( 26 setBodyInnerHTML(
27 "<div id='div' contentEditable='true' style='outline:none'>XYZ</div>"); 27 "<div id='div' contentEditable='true' style='outline:none'>XYZ</div>");
28 document().page()->focusController().setActive(true); 28 document().page()->focusController().setActive(true);
29 document().page()->focusController().setFocused(true); 29 document().page()->focusController().setFocused(true);
30 Element& div = *toElement(document().body()->firstChild()); 30 Element& div = *toElement(document().body()->firstChild());
31 InlineTextBox& textInlineBox = 31 InlineTextBox& textInlineBox =
32 *toLayoutText(div.firstChild()->layoutObject())->firstTextBox(); 32 *toLayoutText(div.firstChild()->layoutObject())->firstTextBox();
33 33
34 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 34 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
35 EXPECT_DISPLAY_LIST( 35 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
36 rootPaintController().getDisplayItemList(), 6, 36 EXPECT_DISPLAY_LIST(
37 TestDisplayItem(layoutView(), 37 rootPaintController().getDisplayItemList(), 4,
38 DisplayItem::kClipFrameToVisibleContentRect), 38 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
39 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), 39 TestDisplayItem(layoutView(), documentBackgroundType),
40 TestDisplayItem(layoutView(), documentBackgroundType), 40 TestDisplayItem(textInlineBox, foregroundType),
41 TestDisplayItem(textInlineBox, foregroundType), 41 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
42 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), 42 } else {
43 TestDisplayItem(layoutView(), 43 EXPECT_DISPLAY_LIST(
44 DisplayItem::clipTypeToEndClipType( 44 rootPaintController().getDisplayItemList(), 6,
45 DisplayItem::kClipFrameToVisibleContentRect))); 45 TestDisplayItem(layoutView(),
46 DisplayItem::kClipFrameToVisibleContentRect),
47 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
48 TestDisplayItem(layoutView(), documentBackgroundType),
49 TestDisplayItem(textInlineBox, foregroundType),
50 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
51 TestDisplayItem(layoutView(),
52 DisplayItem::clipTypeToEndClipType(
53 DisplayItem::kClipFrameToVisibleContentRect)));
54 }
46 } else { 55 } else {
47 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2, 56 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2,
48 TestDisplayItem(layoutView(), documentBackgroundType), 57 TestDisplayItem(layoutView(), documentBackgroundType),
49 TestDisplayItem(textInlineBox, foregroundType)); 58 TestDisplayItem(textInlineBox, foregroundType));
50 } 59 }
51 60
52 div.focus(); 61 div.focus();
53 document().view()->updateAllLifecyclePhases(); 62 document().view()->updateAllLifecyclePhases();
54 63
55 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 64 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
56 EXPECT_DISPLAY_LIST( 65 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
57 rootPaintController().getDisplayItemList(), 7, 66 EXPECT_DISPLAY_LIST(
58 TestDisplayItem(layoutView(), 67 rootPaintController().getDisplayItemList(), 5,
59 DisplayItem::kClipFrameToVisibleContentRect), 68 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
60 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), 69 TestDisplayItem(layoutView(), documentBackgroundType),
61 TestDisplayItem(layoutView(), documentBackgroundType), 70 TestDisplayItem(textInlineBox, foregroundType),
62 TestDisplayItem(textInlineBox, foregroundType), 71 TestDisplayItem(*document().frame()->selection().m_frameCaret,
63 TestDisplayItem(*document().frame()->selection().m_frameCaret, 72 DisplayItem::kCaret), // New!
64 DisplayItem::kCaret), // New! 73 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
65 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), 74 } else {
66 TestDisplayItem(layoutView(), 75 EXPECT_DISPLAY_LIST(
67 DisplayItem::clipTypeToEndClipType( 76 rootPaintController().getDisplayItemList(), 7,
68 DisplayItem::kClipFrameToVisibleContentRect))); 77 TestDisplayItem(layoutView(),
78 DisplayItem::kClipFrameToVisibleContentRect),
79 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
80 TestDisplayItem(layoutView(), documentBackgroundType),
81 TestDisplayItem(textInlineBox, foregroundType),
82 TestDisplayItem(*document().frame()->selection().m_frameCaret,
83 DisplayItem::kCaret), // New!
84 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
85 TestDisplayItem(layoutView(),
86 DisplayItem::clipTypeToEndClipType(
87 DisplayItem::kClipFrameToVisibleContentRect)));
88 }
69 } else { 89 } else {
70 EXPECT_DISPLAY_LIST( 90 EXPECT_DISPLAY_LIST(
71 rootPaintController().getDisplayItemList(), 3, 91 rootPaintController().getDisplayItemList(), 3,
72 TestDisplayItem(layoutView(), documentBackgroundType), 92 TestDisplayItem(layoutView(), documentBackgroundType),
73 TestDisplayItem(textInlineBox, foregroundType), 93 TestDisplayItem(textInlineBox, foregroundType),
74 TestDisplayItem(*document().frame()->selection().m_frameCaret, 94 TestDisplayItem(*document().frame()->selection().m_frameCaret,
75 DisplayItem::kCaret)); // New! 95 DisplayItem::kCaret)); // New!
76 } 96 }
77 } 97 }
78 98
79 TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, InlineRelayout) { 99 TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, InlineRelayout) {
80 setBodyInnerHTML( 100 setBodyInnerHTML(
81 "<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA " 101 "<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA "
82 "BBBBBBBBBB</div>"); 102 "BBBBBBBBBB</div>");
83 Element& div = *toElement(document().body()->firstChild()); 103 Element& div = *toElement(document().body()->firstChild());
84 LayoutBlock& divBlock = 104 LayoutBlock& divBlock =
85 *toLayoutBlock(document().body()->firstChild()->layoutObject()); 105 *toLayoutBlock(document().body()->firstChild()->layoutObject());
86 LayoutText& text = *toLayoutText(divBlock.firstChild()); 106 LayoutText& text = *toLayoutText(divBlock.firstChild());
87 InlineTextBox& firstTextBox = *text.firstTextBox(); 107 InlineTextBox& firstTextBox = *text.firstTextBox();
88 108
89 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 109 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
90 EXPECT_DISPLAY_LIST( 110 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
91 rootPaintController().getDisplayItemList(), 6, 111 EXPECT_DISPLAY_LIST(
92 TestDisplayItem(layoutView(), 112 rootPaintController().getDisplayItemList(), 4,
93 DisplayItem::kClipFrameToVisibleContentRect), 113 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
94 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), 114 TestDisplayItem(layoutView(), documentBackgroundType),
95 TestDisplayItem(layoutView(), documentBackgroundType), 115 TestDisplayItem(firstTextBox, foregroundType),
96 TestDisplayItem(firstTextBox, foregroundType), 116 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
97 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), 117 } else {
98 TestDisplayItem(layoutView(), 118 EXPECT_DISPLAY_LIST(
99 DisplayItem::clipTypeToEndClipType( 119 rootPaintController().getDisplayItemList(), 6,
100 DisplayItem::kClipFrameToVisibleContentRect))); 120 TestDisplayItem(layoutView(),
121 DisplayItem::kClipFrameToVisibleContentRect),
122 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
123 TestDisplayItem(layoutView(), documentBackgroundType),
124 TestDisplayItem(firstTextBox, foregroundType),
125 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
126 TestDisplayItem(layoutView(),
127 DisplayItem::clipTypeToEndClipType(
128 DisplayItem::kClipFrameToVisibleContentRect)));
129 }
101 } else { 130 } else {
102 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2, 131 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2,
103 TestDisplayItem(layoutView(), documentBackgroundType), 132 TestDisplayItem(layoutView(), documentBackgroundType),
104 TestDisplayItem(firstTextBox, foregroundType)); 133 TestDisplayItem(firstTextBox, foregroundType));
105 } 134 }
106 135
107 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px"); 136 div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
108 document().view()->updateAllLifecyclePhases(); 137 document().view()->updateAllLifecyclePhases();
109 138
110 LayoutText& newText = *toLayoutText(divBlock.firstChild()); 139 LayoutText& newText = *toLayoutText(divBlock.firstChild());
111 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); 140 InlineTextBox& newFirstTextBox = *newText.firstTextBox();
112 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); 141 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
113 142
114 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 143 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
115 EXPECT_DISPLAY_LIST( 144 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
116 rootPaintController().getDisplayItemList(), 7, 145 EXPECT_DISPLAY_LIST(
117 TestDisplayItem(layoutView(), 146 rootPaintController().getDisplayItemList(), 5,
118 DisplayItem::kClipFrameToVisibleContentRect), 147 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
119 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), 148 TestDisplayItem(layoutView(), documentBackgroundType),
120 TestDisplayItem(layoutView(), documentBackgroundType), 149 TestDisplayItem(newFirstTextBox, foregroundType),
121 TestDisplayItem(newFirstTextBox, foregroundType), 150 TestDisplayItem(secondTextBox, foregroundType),
122 TestDisplayItem(secondTextBox, foregroundType), 151 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
123 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), 152 } else {
124 TestDisplayItem(layoutView(), 153 EXPECT_DISPLAY_LIST(
125 DisplayItem::clipTypeToEndClipType( 154 rootPaintController().getDisplayItemList(), 7,
126 DisplayItem::kClipFrameToVisibleContentRect))); 155 TestDisplayItem(layoutView(),
156 DisplayItem::kClipFrameToVisibleContentRect),
157 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
158 TestDisplayItem(layoutView(), documentBackgroundType),
159 TestDisplayItem(newFirstTextBox, foregroundType),
160 TestDisplayItem(secondTextBox, foregroundType),
161 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
162 TestDisplayItem(layoutView(),
163 DisplayItem::clipTypeToEndClipType(
164 DisplayItem::kClipFrameToVisibleContentRect)));
165 }
127 } else { 166 } else {
128 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 3, 167 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 3,
129 TestDisplayItem(layoutView(), documentBackgroundType), 168 TestDisplayItem(layoutView(), documentBackgroundType),
130 TestDisplayItem(newFirstTextBox, foregroundType), 169 TestDisplayItem(newFirstTextBox, foregroundType),
131 TestDisplayItem(secondTextBox, foregroundType)); 170 TestDisplayItem(secondTextBox, foregroundType));
132 } 171 }
133 } 172 }
134 173
135 TEST_F(PaintControllerPaintTestForSlimmingPaintV2, ChunkIdClientCacheFlag) { 174 TEST_F(PaintControllerPaintTestForSlimmingPaintV2, ChunkIdClientCacheFlag) {
136 setBodyInnerHTML( 175 setBodyInnerHTML(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // one. 242 // one.
204 TestDisplayItem(subDiv, backgroundType), 243 TestDisplayItem(subDiv, backgroundType),
205 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), 244 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence),
206 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), 245 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
207 TestDisplayItem(layoutView(), 246 TestDisplayItem(layoutView(),
208 DisplayItem::clipTypeToEndClipType( 247 DisplayItem::clipTypeToEndClipType(
209 DisplayItem::kClipFrameToVisibleContentRect))); 248 DisplayItem::kClipFrameToVisibleContentRect)));
210 } 249 }
211 250
212 } // namespace blink 251 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698