Commit eae957ea authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

Fix flakes in external/wpt/css/css-tables/html5-table-formatting-3.html

Split off from https://crrev.com/c/1751324

There is a race condition between loading all parts of the document and
running the test. This patch fixes it.

Bug: 971191
Change-Id: Ie1090416758553d8e5fa36a8ac4592cd3ce5ceb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1760912
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688439}
parent 447e1f68
This is a testharness.js-based test.
PASS Control test for table-cell padding and border-spacing, etc (width)
PASS Control test for table-cell padding and border-spacing (height)
PASS Anonymous consecutive columns spanned by the same set of cells are merged
FAIL Anonymous consecutive rows spanned by the same set of cells are merged assert_equals: expected 100 but got 75
FAIL Explicitely-defined consecutive columns spanned by the same set of cells are not merged assert_equals: expected 75 but got 50
PASS Explicitely-defined consecutive rows spanned by the same set of cells are not merged
FAIL Explicitely-defined consecutive columns spanned by the same set of cells are not merged, and cells span across border-spacing assert_equals: expected 12.5 but got 0
FAIL Explicitely-defined consecutive rows spanned by the same set of cells are not merged, and cells span across border-spacing assert_equals: expected 12.5 but got 12
Harness: the test ran to completion.
...@@ -60,47 +60,48 @@ ...@@ -60,47 +60,48 @@
xtd.parentNode.replaceChild(td,xtd); xtd.parentNode.replaceChild(td,xtd);
} }
generate_tests(assert_equals, [ document.body.onload = () => {
[ generate_tests(assert_equals, [
"Control test for table-cell padding and border-spacing, etc (width)", [
document.querySelector("x-table:nth-of-type(1)").offsetWidth, "Control test for table-cell padding and border-spacing, etc (width)",
100 document.querySelector("x-table:nth-of-type(1)").offsetWidth,
], 100
[ ],
"Control test for table-cell padding and border-spacing (height)", [
document.querySelector("x-table:nth-of-type(1)").offsetHeight, "Control test for table-cell padding and border-spacing (height)",
100 document.querySelector("x-table:nth-of-type(1)").offsetHeight,
], 100
[ ],
"Anonymous consecutive columns spanned by the same set of cells are merged", [
document.querySelector("x-table:nth-of-type(2)").offsetWidth, "Anonymous consecutive columns spanned by the same set of cells are merged",
100 document.querySelector("x-table:nth-of-type(2)").offsetWidth,
], 100
[ ],
"Anonymous consecutive rows spanned by the same set of cells are merged", [
document.querySelector("x-table:nth-of-type(2)").offsetHeight, "Anonymous consecutive rows spanned by the same set of cells are merged",
100 document.querySelector("x-table:nth-of-type(2)").offsetHeight,
], 100
[ ],
"Explicitely-defined consecutive columns spanned by the same set of cells are not merged", [
document.querySelector("x-table:nth-of-type(3)").offsetWidth, "Explicitely-defined consecutive columns spanned by the same set of cells are not merged",
75 document.querySelector("x-table:nth-of-type(3)").offsetWidth,
], 75
[ ],
"Explicitely-defined consecutive rows spanned by the same set of cells are not merged", [
document.querySelector("x-table:nth-of-type(3)").offsetHeight, "Explicitely-defined consecutive rows spanned by the same set of cells are not merged",
75 document.querySelector("x-table:nth-of-type(3)").offsetHeight,
], 75
[ ],
"Explicitely-defined consecutive columns spanned by the same set of cells are not merged, and cells span across border-spacing", [
document.querySelector("x-table:nth-of-type(4) x-col").getBoundingClientRect().width, "Explicitely-defined consecutive columns spanned by the same set of cells are not merged, and cells span across border-spacing",
12.5 document.querySelector("x-table:nth-of-type(4) x-col").getBoundingClientRect().width,
], 12.5
[ ],
"Explicitely-defined consecutive rows spanned by the same set of cells are not merged, and cells span across border-spacing", [
document.querySelector("x-table:nth-of-type(4) x-tr").getBoundingClientRect().height, "Explicitely-defined consecutive rows spanned by the same set of cells are not merged, and cells span across border-spacing",
12.5 document.querySelector("x-table:nth-of-type(4) x-tr").getBoundingClientRect().height,
], 12.5
]) ],
])
}
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment