Commit b905a8b7 authored by tkent@chromium.org's avatar tkent@chromium.org

testharnessreport: Hide elements in tests by removing them from the document...

testharnessreport: Hide elements in tests by removing them from the document tree, instead of visibility:hidden.

This fixes the flakiness of web-platform-tests/webrtc/datachannel-
emptystring.html.

[1] made the test flaky because:
 - It added a chance to invoke onSendChannelOpen()
 - It prints some lines into <div id=msg>.
 - Text dump of visibility:hidden doesn't remove EOLs represented by
   <br>s.

This CL resolves this issue by removing elements completely by
body.textContent = ''.  Setting display:none instead of visibility:hidden
also works, but body.textContent = '' is much simpler.

[1] https://src.chromium.org/viewvc/blink?revision=201628&view=revision
BUG=528120

Review URL: https://codereview.chromium.org/1332523002

git-svn-id: svn://svn.chromium.org/blink/trunk@201897 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 47cb0077
......@@ -880,7 +880,6 @@ crbug.com/498021 [ Linux ] fast/text/international/hindi-spacing.html [ Failure
crbug.com/528110 [ Debug ] screen_orientation/screenorientation-detached-notify-no-crash.html [ Crash Pass ]
crbug.com/528110 [ Debug ] fast/dom/Window/property-access-on-cached-window-after-frame-navigated.html [ Crash Pass ]
crbug.com/528120 imported/web-platform-tests/webrtc/datachannel-emptystring.html [ Failure Pass Timeout ]
crbug.com/528122 [ Mac ] fast/text/justify-ideograph-vertical.html [ Failure Pass ]
# Significant Slimming Paint failure.
......
......@@ -103,14 +103,7 @@ add_completion_callback(function (tests, harness_status) {
if ((isCSSWGTest() || isJSTest()) && logDiv) {
// Assume it's a CSSWG style test, and anything other than the log div isn't
// material to the testrunner output, so should be hidden from the text dump
var next = null;
for (var child = document.body.firstChild; child; child = next) {
next = child.nextSibling;
if (child.nodeType == Node.ELEMENT_NODE)
child.style.visibility = "hidden";
else if (child.nodeType == Node.TEXT_NODE)
document.body.removeChild(child);
}
document.body.textContent = '';
}
}
......
......@@ -103,14 +103,7 @@ add_completion_callback(function (tests, harness_status) {
if ((isCSSWGTest() || isJSTest()) && logDiv) {
// Assume it's a CSSWG style test, and anything other than the log div isn't
// material to the testrunner output, so should be hidden from the text dump
var next = null;
for (var child = document.body.firstChild; child; child = next) {
next = child.nextSibling;
if (child.nodeType == Node.ELEMENT_NODE)
child.style.visibility = "hidden";
else if (child.nodeType == Node.TEXT_NODE)
document.body.removeChild(child);
}
document.body.textContent = '';
}
}
......
This is a testharness.js-based test.
FAIL Starting document.location.hostname is correct (127.0.0.1:8000) assert_equals: Starting document.location.hostname is correct (127.0.0.1:8000) expected "127.0.0.1:8000" but got "127.0.0.1"
PASS window.performance is defined
......
CONSOLE WARNING: <source src> with a <picture> parent is invalid and therefore ignored. Please use <source srcset> instead.
CONSOLE ERROR: Failed parsing 'srcset' attribute value since it has multiple 'x' descriptors or a mix of 'x' and 'w'/'h' descriptors.
CONSOLE ERROR: Dropped srcset candidate data:,b
CONSOLE ERROR: Failed parsing 'srcset' attribute value since it has multiple 'x' descriptors or a mix of 'x' and 'w'/'h' descriptors.
CONSOLE ERROR: Dropped srcset candidate data:,b
This is a testharness.js-based test.
PASS <img data-expect="">
PASS <img src="" data-expect="">
......
This is a testharness.js-based test.
PASS The prototype for OL is HTMLOListElement.prototype
FAIL 'reversed' property should be defined on OL. assert_own_property: expected property "reversed" missing
......
......@@ -103,14 +103,7 @@ add_completion_callback(function (tests, harness_status) {
if ((isCSSWGTest() || isJSTest()) && logDiv) {
// Assume it's a CSSWG style test, and anything other than the log div isn't
// material to the testrunner output, so should be hidden from the text dump
var next = null;
for (var child = document.body.firstChild; child; child = next) {
next = child.nextSibling;
if (child.nodeType == Node.ELEMENT_NODE)
child.style.visibility = "hidden";
else if (child.nodeType == Node.TEXT_NODE)
document.body.removeChild(child);
}
document.body.textContent = '';
}
}
......
......@@ -103,14 +103,7 @@ add_completion_callback(function (tests, harness_status) {
if ((isCSSWGTest() || isJSTest()) && logDiv) {
// Assume it's a CSSWG style test, and anything other than the log div isn't
// material to the testrunner output, so should be hidden from the text dump
var next = null;
for (var child = document.body.firstChild; child; child = next) {
next = child.nextSibling;
if (child.nodeType == Node.ELEMENT_NODE)
child.style.visibility = "hidden";
else if (child.nodeType == Node.TEXT_NODE)
document.body.removeChild(child);
}
document.body.textContent = '';
}
}
......
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