test: wait for beforeunload handler to be installed (#23874)
This commit is contained in:
parent
fbf397e15d
commit
5918dd6e65
7 changed files with 24 additions and 26 deletions
14
spec/fixtures/api/beforeunload-false.html
vendored
14
spec/fixtures/api/beforeunload-false.html
vendored
|
@ -1,14 +0,0 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// Only prevent unload on the first window close
|
||||
var unloadPrevented = false;
|
||||
window.onbeforeunload = function() {
|
||||
if (!unloadPrevented) {
|
||||
unloadPrevented = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue