test: fix flaky onbeforeunload tests (#19085)
This commit is contained in:
parent
c2d78deeca
commit
616856552f
4 changed files with 5 additions and 4 deletions
|
@ -13,7 +13,7 @@
|
|||
return '';
|
||||
}
|
||||
}
|
||||
window.close();
|
||||
window.onload = () => window.close();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
window.close();
|
||||
// unload events don't get run unless load events have run.
|
||||
window.onload = () => window.close()
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
require('electron').remote.getCurrentWindow().emit('onbeforeunload');
|
||||
}, 0);
|
||||
}
|
||||
window.close();
|
||||
window.onload = () => window.close();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
2
spec/fixtures/api/close.html
vendored
2
spec/fixtures/api/close.html
vendored
|
@ -4,7 +4,7 @@
|
|||
window.addEventListener('unload', function (e) {
|
||||
require('fs').writeFileSync(__dirname + '/close', 'close');
|
||||
}, false);
|
||||
window.close();
|
||||
window.onload = () => window.close();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue