Bug 1634249 [wpt PR 23333] - Simplify script text modifications test, a=testonly
authorDominic Farolino <dom@chromium.org>
Wed, 13 May 2020 03:56:17 +0000
changeset 531004 fbc3ad389e6b984f6ef3e859de88638c703c52f8
parent 531003 07ef47b4bd6fa8fed4363348360dc284e646a4c5
child 531005 2d139f8ef6a5ab8bd6bee59fa34905304dd9ada6
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1634249, 23333, 1091912, 686281, 2173476, 764161
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1634249 [wpt PR 23333] - Simplify script text modifications test, a=testonly Automatic update from web-platform-tests Simplify script text modifications test This test was previously added in https://crrev.com/c/1091912/. The test asserts the correct behavior, but does so in a way that relies certain async script scheduling behavior which is not mandatory. This CL changes the test to assert the same thing, but without relying on an async script, and implicitly its scheduling. Bug: 686281 Change-Id: I7b1ae20fb77cfefdfc68dd12a0db9be9e2314cfe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2173476 Commit-Queue: Dominic Farolino <dom@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#764161} -- wpt-commits: 6f5416ad894f15f369ce0bc70784773aaf5fe01a wpt-pr: 23333
deleted file mode 100644
--- a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/resources/script-text-modifications.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import time
-def main(request, response):
-    time.sleep(1.0);
-    return [("Content-type", "text/javascript")], """
-var s = document.getElementById('script0');
-s.innerText = 't.unreached_func("This should not be evaluated")();';
--- a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text-modifications.html
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-text-modifications.html
@@ -4,26 +4,31 @@
 <title>Modify HTMLScriptElement's text after #prepare-a-script</title>
 <link rel=help href="https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 var t = async_test("Modify inline script element's text " +
                    "after prepare-a-script before evaluation");
+function changeScriptText() {
+  document.querySelector('#script0').textContent =
+    't.unreached_func("This should not be evaluated")();';
+t.step_timeout(changeScriptText, 500);
 <!-- This is "a style sheet that is blocking scripts" and thus ... -->
-<link rel="stylesheet" href="/common/slow.py"></link>
-<script src="resources/script-text-modifications.py" async></script>
+<link rel="stylesheet" href="/common/slow.py?pipe=trickle(d1)"></link>
 <!-- This inline script becomes a parser-blocking script, and thus
-the async script above is evaluated after script0 is inserted into DOM,
-prepare-a-script'ed, and before its evaluation. -->
+the step_timeout is evaluated after script0 is inserted into DOM,
+prepare-a-script'ed, but before its evaluation. -->
 <script id="script0">
 t.step(() => {
     // When this is evaluated after the stylesheet is loaded,
     // script0's innerText is modified by the async script above,
     // but the evaluated script is still the original script here,
     // not what is overwritten, because "child text content" is taken in
     // #prepare-a-script and passed to "creating a classic script".
     var s = document.getElementById('script0');