<!doctype html>
<title>InOrder Script Execution Order with allowlist</title>
<html>
<head>
<meta charset="utf-8">
<meta name=variant content="?default">
<meta name=variant content="?reload">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/helper.js"></script>
</head>
<body>
<script>
const reload_key = 'run-after-reload';
if (location.search == '?reload' && !window.localStorage.getItem(reload_key)) {
window.localStorage.setItem(reload_key, true);
location.reload();
} else {
window.localStorage.clear();
test();
}
function test() {
setup({ single_test: true });
function finish() {
assert_array_equals(
window.result,
["Inline1", "Sync1", "Sync2", "EndOfBody"], "Execution order");
// When SelectiveInOrder is enabled, the order is following:
// ["Inline1", "Sync2", "EndOfBody", "Sync1"]
done();
}
logScript("Inline1");
window.addEventListener("load", finish);
}
</script>
<script
src="http://bad3p.test:{{ports[http][0]}}/wpt_internal/in-order-script-scheduling/resources/sync-script-1.js?pipe=trickle(d1)"></script>
<script src="../resources/sync-script-2.js"></script>
<pre id="bodyend">End</pre>
</body>