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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp

Issue 2455223002: Fix LayoutTableSectionTest test cases which called a method on nil. (Closed)
Patch Set: fix bad merge Created 4 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
« no previous file with comments | « testing/buildbot/chromium.fyi.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp
index ae95ae8d16f05f5897e4c7d4bb76b30f5d16cf12..30cda09ad0218ada1553cdb88fa544e2b149c1c0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSectionTest.cpp
@@ -16,13 +16,15 @@ TEST_F(LayoutTableSectionTest,
BackgroundIsKnownToBeOpaqueWithLayerAndCollapsedBorder) {
setBodyInnerHTML(
"<table style='border-collapse: collapse'>"
- " <thead style='will-change: transform; background-color: blue'>"
+ " <thead id='section' style='will-change: transform; background-color: "
+ "blue'>"
" <tr><td>Cell</td></tr>"
" </thead>"
"</table>");
- LayoutTableSection* section = toLayoutTableSection(
- document().body()->firstChild()->firstChild()->layoutObject());
+ LayoutTableSection* section =
+ toLayoutTableSection(getLayoutObjectByElementId("section"));
+ EXPECT_TRUE(section);
EXPECT_FALSE(
section->backgroundIsKnownToBeOpaqueInRect(LayoutRect(0, 0, 1, 1)));
}
@@ -30,13 +32,14 @@ TEST_F(LayoutTableSectionTest,
TEST_F(LayoutTableSectionTest, BackgroundIsKnownToBeOpaqueWithBorderSpacing) {
setBodyInnerHTML(
"<table style='border-spacing: 10px'>"
- " <thead style='background-color: blue'>"
+ " <thead id='section' style='background-color: blue'>"
" <tr><td>Cell</td></tr>"
" </thead>"
"</table>");
- LayoutTableSection* section = toLayoutTableSection(
- document().body()->firstChild()->firstChild()->layoutObject());
+ LayoutTableSection* section =
+ toLayoutTableSection(getLayoutObjectByElementId("section"));
+ EXPECT_TRUE(section);
EXPECT_FALSE(
section->backgroundIsKnownToBeOpaqueInRect(LayoutRect(0, 0, 1, 1)));
}
@@ -44,14 +47,15 @@ TEST_F(LayoutTableSectionTest, BackgroundIsKnownToBeOpaqueWithBorderSpacing) {
TEST_F(LayoutTableSectionTest, BackgroundIsKnownToBeOpaqueWithEmptyCell) {
setBodyInnerHTML(
"<table style='border-spacing: 10px'>"
- " <thead style='background-color: blue'>"
+ " <thead id='section' style='background-color: blue'>"
" <tr><td>Cell</td></tr>"
" <tr><td>Cell</td><td>Cell</td></tr>"
" </thead>"
"</table>");
- LayoutTableSection* section = toLayoutTableSection(
- document().body()->firstChild()->firstChild()->layoutObject());
+ LayoutTableSection* section =
+ toLayoutTableSection(getLayoutObjectByElementId("section"));
+ EXPECT_TRUE(section);
EXPECT_FALSE(
section->backgroundIsKnownToBeOpaqueInRect(LayoutRect(0, 0, 1, 1)));
}
@@ -64,6 +68,7 @@ TEST_F(LayoutTableSectionTest, EmptySectionDirtiedRows) {
LayoutTableSection* section =
toLayoutTableSection(getLayoutObjectByElementId("section"));
+ EXPECT_TRUE(section);
CellSpan cellSpan = section->dirtiedRows(LayoutRect(50, 50, 100, 100));
EXPECT_EQ(0u, cellSpan.start());
EXPECT_EQ(0u, cellSpan.end());
@@ -77,6 +82,7 @@ TEST_F(LayoutTableSectionTest, EmptySectionDirtiedEffectiveColumns) {
LayoutTableSection* section =
toLayoutTableSection(getLayoutObjectByElementId("section"));
+ EXPECT_TRUE(section);
CellSpan cellSpan =
section->dirtiedEffectiveColumns(LayoutRect(50, 50, 100, 100));
// The table has at least 1 column even if there is no cell.
« no previous file with comments | « testing/buildbot/chromium.fyi.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698