Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for scripts running after its script thread is closed
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...ml/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
18 changes: 18 additions & 0 deletions
18
...sts/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
1 change: 1 addition & 0 deletions
1
...tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
script_executed(); |