mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Add test for scripts running after its script thread is closed
This commit is contained in:
parent
315ffe7677
commit
3f285fd437
4 changed files with 37 additions and 0 deletions
|
@ -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();
|
Loading…
Add table
Add a link
Reference in a new issue