From 15b753961a3586f77810836d9997c2ec7234b880 Mon Sep 17 00:00:00 2001 From: Stephen McGruer Date: Tue, 2 Feb 2021 09:12:06 +0000 Subject: [PATCH] Bug 1689115 [wpt PR 27351] - [testharness.js] Disable assert tracking on workers, a=testonly Automatic update from web-platform-tests [testharness.js] Disable assert tracking on workers (#27351) We are continuing to see a performance regression from assert tracking in Chromium. After investigation, it appears that the root problem is that there is no way currently for a testharness.js script loaded in a worker to know that it shouldn't be tracking asserts (since testharnessreport.js isn't loaded). To fix the performance hit, this commit disables assert tracking entirely in workers. This is a behavior regression for the feature, but is necessary to avoid an unacceptable performance regression. Associated Chromium bug: https://crbug.com/1170588 -- wpt-commits: a1f5466c51ef000b4b4fcf66473e4f9a2b11c503 wpt-pr: 27351 --- testing/web-platform/tests/resources/testharness.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/testing/web-platform/tests/resources/testharness.js b/testing/web-platform/tests/resources/testharness.js index 11e31b133ddd..3623aa4d57e6 100644 --- a/testing/web-platform/tests/resources/testharness.js +++ b/testing/web-platform/tests/resources/testharness.js @@ -2780,7 +2780,15 @@ policies and contribution forms [3]. this.current_test = null; this.asserts_run = []; - this.output = settings.output; + + // Track whether output is enabled, and thus whether or not we should + // track asserts. + // + // On workers we don't get properties set from testharnessreport.js, so + // we don't know whether or not to track asserts. To avoid the + // resulting performance hit, we assume we are not meant to. This means + // that assert tracking does not function on workers. + this.output = settings.output && 'document' in global_scope; this.status = new TestsStatus(); -- 2.11.4.GIT