test: wait for beforeunload handler to be installed (#23874)

This commit is contained in:
Cheng Zhao 2020-06-02 11:32:39 +09:00 committed by GitHub
parent fbf397e15d
commit 5918dd6e65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 26 deletions

View file

@ -0,0 +1,14 @@
<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 '';
}
}
</script>
</body>
</html>