Add test for scripts running after its script thread is closed

This commit is contained in:
Connor Brewster 2016-07-05 21:23:57 -06:00
parent 315ffe7677
commit 3f285fd437
4 changed files with 37 additions and 0 deletions

View file

@ -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>

View file

@ -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>