Skip to content

Commit fcfc255

Browse files
committed
Widen the control request margin in parser-blocking script abort tests
1 parent 19a30ae commit fcfc255

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎domparsing/stream-html-parser-blocking-script.html‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,12 @@
134134
const name = parsed.href;
135135
// Implementations may cancel an in-flight script fetch on parser abort, in
136136
// which case no PerformanceResourceTiming entry is emitted. Race against a
137-
// slightly slower un-aborted control request so cancelled fetches settle
138-
// promptly without waiting for the 3s fallback timeout.
137+
// slower un-aborted control request so cancelled fetches settle promptly
138+
// without waiting for the 3s fallback timeout. The control is delayed well
139+
// beyond the script's delay so that, in an implementation that wrongly
140+
// keeps fetching and executes the script, the script runs first.
139141
const controlUrl = new URL(parsed);
140-
controlUrl.search = controlUrl.search.replace("trickle(d0.2)", "trickle(d0.3)");
142+
controlUrl.search = controlUrl.search.replace("trickle(d0.2)", "trickle(d0.6)");
141143
controlUrl.searchParams.set("control_probe", Math.random());
142144
const controlDone = fetch(controlUrl).then(r => r.text(), () => {});
143145
let observer;
@@ -589,7 +591,7 @@
589591
iframe.contentWindow.notifyParent = () => {
590592
window.iframe_blocked_ran = true;
591593
};
592-
const controlDone = fetch("resources/slow.js?pipe=trickle(d0.3)&f12_control=1")
594+
const controlDone = fetch("resources/slow.js?pipe=trickle(d0.6)&f12_control=1")
593595
.then(r => r.text())
594596
.then(() => new Promise(r => t.step_timeout(r, 0)));
595597
const target = iframe.contentDocument.getElementById("target");

0 commit comments

Comments
 (0)