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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp

Issue 2884733003: Remove a duplicate and leaking test LayoutTableCellTest.AbsoluteColumnIndex (Closed)
Patch Set: Created 3 years, 7 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
« 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 LayoutRect LocalVisualRect(const LayoutTableCell* cell) { 82 LayoutRect LocalVisualRect(const LayoutTableCell* cell) {
83 return cell->LocalVisualRect(); 83 return cell->LocalVisualRect();
84 } 84 }
85 85
86 LayoutTableCell* GetCellByElementId(const char* id) { 86 LayoutTableCell* GetCellByElementId(const char* id) {
87 return ToLayoutTableCell(GetLayoutObjectByElementId(id)); 87 return ToLayoutTableCell(GetLayoutObjectByElementId(id));
88 } 88 }
89 }; 89 };
90 90
91 TEST_F(LayoutTableCellTest, AbsoluteColumnIndex) {
92 auto* cell = LayoutTableCell::CreateAnonymous(&GetDocument());
93 EXPECT_FALSE(cell->HasSetAbsoluteColumnIndex());
94 cell->SetAbsoluteColumnIndex(kMaxColumnIndex);
95 EXPECT_TRUE(cell->HasSetAbsoluteColumnIndex());
96 EXPECT_NE(kUnsetColumnIndex, cell->AbsoluteColumnIndex());
97 EXPECT_EQ(kMaxColumnIndex, cell->AbsoluteColumnIndex());
98 }
99
100 TEST_F(LayoutTableCellTest, ResetColspanIfTooBig) { 91 TEST_F(LayoutTableCellTest, ResetColspanIfTooBig) {
101 SetBodyInnerHTML("<table><td id='cell' colspan='14000'></td></table>"); 92 SetBodyInnerHTML("<table><td id='cell' colspan='14000'></td></table>");
102 ASSERT_EQ(GetCellByElementId("cell")->ColSpan(), 8190U); 93 ASSERT_EQ(GetCellByElementId("cell")->ColSpan(), 8190U);
103 } 94 }
104 95
105 TEST_F(LayoutTableCellTest, DoNotResetColspanJustBelowBoundary) { 96 TEST_F(LayoutTableCellTest, DoNotResetColspanJustBelowBoundary) {
106 SetBodyInnerHTML("<table><td id='cell' colspan='8190'></td></table>"); 97 SetBodyInnerHTML("<table><td id='cell' colspan='8190'></td></table>");
107 ASSERT_EQ(GetCellByElementId("cell")->ColSpan(), 8190U); 98 ASSERT_EQ(GetCellByElementId("cell")->ColSpan(), 8190U);
108 } 99 }
109 100
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 LayoutRect expected_visual_rect2 = cell2->BorderBoxRect(); 282 LayoutRect expected_visual_rect2 = cell2->BorderBoxRect();
292 // Expand outer half border width at each side. For the bottom side, expand 283 // Expand outer half border width at each side. For the bottom side, expand
293 // more because the left border is lengthened to cover the joint with the 284 // more because the left border is lengthened to cover the joint with the
294 // bottom border of the cell to the left. 285 // bottom border of the cell to the left.
295 expected_visual_rect2.ExpandEdges(LayoutUnit(1), LayoutUnit(8), LayoutUnit(5), 286 expected_visual_rect2.ExpandEdges(LayoutUnit(1), LayoutUnit(8), LayoutUnit(5),
296 LayoutUnit(7)); 287 LayoutUnit(7));
297 EXPECT_EQ(expected_visual_rect2, LocalVisualRect(cell2)); 288 EXPECT_EQ(expected_visual_rect2, LocalVisualRect(cell2));
298 } 289 }
299 290
300 } // namespace blink 291 } // 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