Skip to content

Commit

Permalink
Merge pull request #1985 from w3c/sync_52fef7b62ddf057572104d8dbef9e1…
Browse files Browse the repository at this point in the history
…3f4bffb634

Merge pull request #1985 from sync_52fef7b62ddf057572104d8dbef9e13f4bffb634
  • Loading branch information
jgraham committed Jul 10, 2015
2 parents ac3ac82 + 52fef7b commit 739f14a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
10 changes: 6 additions & 4 deletions old-tests/submission/Opera/script_scheduling/094.html
Expand Up @@ -8,14 +8,16 @@
<body>

<div id="log">FAILED (This TC requires JavaScript enabled)</div>
<iframe id="myFrame"></iframe>

<script>
var t = async_test(undefined, {timeout:3500});
onload = t.step_func(function() {
document.open();
document.write("<title> scheduler: parser-created defer script after document load</title><script src='/resources/testharness.js'><\/script><script src='/resources/testharnessreport.js'><\/script><script src='testlib/testlib.js'><\/script><script>var t=async_test()<\/script><div id=log></div><script defer src='data:text/javascript,t.done();'><\/script>");
document.close();
setTimeout(t.step_func(function() {assert_unreached()}, 500));
var doc = document.getElementById("myFrame").contentDocument;
var win = document.getElementById("myFrame").contentWindow;
doc.open();
doc.write("<title> scheduler: parser-created defer script after document load</title><script src='/resources/testharness.js'><\/script><script src='/resources/testharnessreport.js'><\/script><script src='testlib/testlib.js'><\/script><script>var t=async_test()<\/script><div id=log></div><script defer src='data:text/javascript,parent.t.done();'><\/script>");
doc.close();
})
</script>
</body></html>
13 changes: 8 additions & 5 deletions old-tests/submission/Opera/script_scheduling/101.html
Expand Up @@ -8,20 +8,23 @@
<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() {
document.open();
document.write("<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><div id='log'>document.written content</div><script>log('inline script #1'); t = async_test();<\/script><script src='scripts/include-1.js'><\/script><script defer src='scripts/include-2.js'><\/script>");
document.close();
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='/resources/testharness.js'><\/script><script src='/resources/testharnessreport.js'><\/script><script src='testlib/testlib.js'><\/script><div id='log'>document.written content</div><script>log('inline script #1'); t = async_test();<\/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.
window.setTimeout(
win.setTimeout(
function() {
window.t.step(
function() {
window.assert_array_equals(window.eventOrder, ['inline script #1', 'external script #1', 'external script #2']);
window.assert_array_equals(win.eventOrder, ['inline script #1', 'external script #1', 'external script #2']);
window.t.done();
})}, 1000);
});
Expand Down

0 comments on commit 739f14a

Please sign in to comment.