From ae5305981691d196a2ae333a156d0e4aaf7fa12d Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Mon, 9 Dec 2024 21:58:16 +0000 Subject: [PATCH] Tests: Don't display imported WPT test output if browser is headless Previously, imported WPT tests didn't display any output if the internals object was exposed. This change adds the condition that the browser must also be running headlessly for test output to not be displayed. --- Tests/LibWeb/Text/input/wpt-import/resources/testharness.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/LibWeb/Text/input/wpt-import/resources/testharness.js b/Tests/LibWeb/Text/input/wpt-import/resources/testharness.js index 9c536f88801..d56e05112d0 100644 --- a/Tests/LibWeb/Text/input/wpt-import/resources/testharness.js +++ b/Tests/LibWeb/Text/input/wpt-import/resources/testharness.js @@ -9,7 +9,7 @@ // default timeout is 10 seconds, test can override if needed var settings = { // Assume we are running tests if the internals object is exposed. - output:!window.hasOwnProperty("internals"), + output: !(window.internals && window.internals.headless), harness_timeout:{ "normal":150000, // NOTE: Overridden for Ladybird due to slow GCC CI "long":300000 // NOTE: Overridden for Ladybird due to slow GCC CI @@ -4549,7 +4549,7 @@ AssertionError.prototype = Object.create(Error.prototype); const get_stack = function() { - if (window.internals) { + if (window.internals && window.internals.headless) { return "(Stack traces disabled in Ladybird test mode)"; }