test: fix flaky onbeforeunload tests (#19085)

This commit is contained in:
Jeremy Apthorp 2019-07-02 13:48:58 -07:00 committed by GitHub
parent c2d78deeca
commit 616856552f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View file

@ -13,7 +13,7 @@
return '';
}
}
window.close();
window.onload = () => window.close();
</script>
</body>
</html>

View file

@ -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>

View file

@ -6,7 +6,7 @@
require('electron').remote.getCurrentWindow().emit('onbeforeunload');
}, 0);
}
window.close();
window.onload = () => window.close();
</script>
</body>
</html>

View file

@ -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>