mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
Use setTimeout instead of setImmediate in fixtures.
The setImmediate is implemented in node and may have unexpected affects.
This commit is contained in:
4
spec/fixtures/api/beforeunload-false.html
vendored
4
spec/fixtures/api/beforeunload-false.html
vendored
@@ -2,9 +2,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
setImmediate(function() {
|
setTimeout(function() {
|
||||||
require('remote').getCurrentWindow().emit('onbeforeunload');
|
require('remote').getCurrentWindow().emit('onbeforeunload');
|
||||||
});
|
}, 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
setImmediate(function() {
|
setTimeout(function() {
|
||||||
require('remote').getCurrentWindow().emit('onbeforeunload');
|
require('remote').getCurrentWindow().emit('onbeforeunload');
|
||||||
});
|
}, 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
window.close();
|
window.close();
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
setImmediate(function() {
|
setTimeout(function() {
|
||||||
require('remote').getCurrentWindow().emit('onbeforeunload');
|
require('remote').getCurrentWindow().emit('onbeforeunload');
|
||||||
});
|
}, 0);
|
||||||
return 'string';
|
return 'string';
|
||||||
}
|
}
|
||||||
window.close();
|
window.close();
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
setImmediate(function() {
|
setTimeout(function() {
|
||||||
require('remote').getCurrentWindow().emit('onbeforeunload');
|
require('remote').getCurrentWindow().emit('onbeforeunload');
|
||||||
});
|
}, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
window.close();
|
window.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user