summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/101.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/101.html')
-rw-r--r--testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/101.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/101.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/101.html
new file mode 100644
index 0000000000..b868f9a447
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/execution-timing/101.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html><head>
+ <title> scheduler: defer script after initial onload event</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="testlib/testlib.js"></script>
+</head>
+<body>
+
+ <div id="log">FAILED (This TC requires JavaScript enabled)</div>
+ <iframe id="myFrame"></iframe>
+
+ <script>
+ var t = async_test();
+ onload = t.step_func(
+ function() {
+ var doc = document.getElementById("myFrame").contentDocument;
+ var win = document.getElementById("myFrame").contentWindow;
+ doc.open();
+ doc.write("<title> scheduler: defer script after initial onload event</title><script src='testlib/testlib.js'><\/script><div id='log'>document.written content</div><script>log('inline script #1');<\/script><script src='scripts/include-1.js'><\/script><script defer src='scripts/include-2.js'><\/script>");
+ doc.close();
+ //Note that the *window* object has changed but the *global scope* of the script has not.
+ var run_t = window.t.step_func(function() {
+ if (!win.eventOrder || win.eventOrder.length != 3) {
+ window.setTimeout(run_t, 100);
+ return;
+ }
+ window.assert_array_equals(win.eventOrder, ['inline script #1', 'external script #1', 'external script #2']);
+ window.t.done();
+ });
+ run_t();
+ });
+ </script>
+</body>
+</html>