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

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

Issue 1909033003: Add FrameView::updateAllLifecyclePhasesExceptPaint and use it in a few cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "core/paint/PaintLayerPainter.h" 6 #include "core/paint/PaintLayerPainter.h"
7 7
8 namespace blink { 8 namespace blink {
9 9
10 using TableCellPainterTest = PaintControllerPaintTest; 10 using TableCellPainterTest = PaintControllerPaintTest;
11 11
12 TEST_F(TableCellPainterTest, TableCellBackgroundInterestRect) 12 TEST_F(TableCellPainterTest, TableCellBackgroundInterestRect)
13 { 13 {
14 setBodyInnerHTML( 14 setBodyInnerHTML(
15 "<style>" 15 "<style>"
16 " td { width: 200px; height: 200px; border: none; }" 16 " td { width: 200px; height: 200px; border: none; }"
17 " tr { background-color: blue; }" 17 " tr { background-color: blue; }"
18 " table { border: none; border-spacing: 0; border-collapse: collapse; } " 18 " table { border: none; border-spacing: 0; border-collapse: collapse; } "
19 "</style>" 19 "</style>"
20 "<table>" 20 "<table>"
21 " <tr><td id='cell1'></td></tr>" 21 " <tr><td id='cell1'></td></tr>"
22 " <tr><td id='cell2'></td></tr>" 22 " <tr><td id='cell2'></td></tr>"
23 "</table>"); 23 "</table>");
24 24
25 LayoutView& layoutView = *document().layoutView(); 25 LayoutView& layoutView = *document().layoutView();
26 LayoutObject& cell1 = *document().getElementById("cell1")->layoutObject(); 26 LayoutObject& cell1 = *document().getElementById("cell1")->layoutObject();
27 LayoutObject& cell2 = *document().getElementById("cell2")->layoutObject(); 27 LayoutObject& cell2 = *document().getElementById("cell2")->layoutObject();
28 28
29 rootPaintController().invalidateAll(); 29 rootPaintController().invalidateAll();
30 updateLifecyclePhasesBeforePaint(); 30 document().view()->updateAllLifecyclePhasesExceptPaint();
31 IntRect interestRect(0, 0, 200, 200); 31 IntRect interestRect(0, 0, 200, 200);
32 paint(&interestRect); 32 paint(&interestRect);
33 33
34 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2, 34 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2,
35 TestDisplayItem(layoutView, DisplayItem::DocumentBackground), 35 TestDisplayItem(layoutView, DisplayItem::DocumentBackground),
36 TestDisplayItem(cell1, DisplayItem::TableCellBackgroundFromRow)); 36 TestDisplayItem(cell1, DisplayItem::TableCellBackgroundFromRow));
37 37
38 updateLifecyclePhasesBeforePaint(); 38 document().view()->updateAllLifecyclePhasesExceptPaint();
39 interestRect = IntRect(0, 300, 200, 1000); 39 interestRect = IntRect(0, 300, 200, 1000);
40 paint(&interestRect); 40 paint(&interestRect);
41 41
42 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2, 42 EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2,
43 TestDisplayItem(layoutView, DisplayItem::DocumentBackground), 43 TestDisplayItem(layoutView, DisplayItem::DocumentBackground),
44 TestDisplayItem(cell2, DisplayItem::TableCellBackgroundFromRow)); 44 TestDisplayItem(cell2, DisplayItem::TableCellBackgroundFromRow));
45 } 45 }
46 46
47 } // namespace blink 47 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698