Skip to content

Commit

Permalink
Add test for scripts running after its script thread is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrewster committed Jul 8, 2016
1 parent 315ffe7 commit 3f285fd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/wpt/metadata/MANIFEST.json
Expand Up @@ -37190,6 +37190,12 @@
"path": "html/semantics/embedded-content/the-img-element/invalid-src.html",
"url": "/html/semantics/embedded-content/the-img-element/invalid-src.html"
}
],
"html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html": [
{
"path": "html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html",
"url": "/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html"
}
]
}
},
Expand Down
@@ -0,0 +1,12 @@
<!doctype html>
<meta charset="utf-8">
<title>Script is not executed after script thread is shutdown</title>
<script>
onload = function() {
script_executed = parent.script_executed;
s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'script-not-executed-after-shutdown.js?pipe=trickle(d3)';
document.body.appendChild(s);
};
</script>
@@ -0,0 +1,18 @@
<!doctype html>
<meta charset="utf-8">
<title>Script is not executed after script thread is shutdown</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="testiframe" src="script-not-executed-after-shutdown-child.html"></iframe>
<script>
async_test(function(t) {
window.script_executed = t.unreached_func("script executed in removed iframe");
let iframe = document.getElementById("testiframe");
iframe.onload = function() {
iframe.parentNode.removeChild(iframe);
};
setTimeout(function() {
t.done();
}, 5000);
});
</script>
@@ -0,0 +1 @@
script_executed();

0 comments on commit 3f285fd

Please sign in to comment.