Use setTimeout instead of setImmediate in fixtures.

The setImmediate is implemented in node and may have unexpected affects.
This commit is contained in:
Cheng Zhao 2013-09-02 16:46:08 +08:00
parent 610ac5b045
commit f17864372e
4 changed files with 8 additions and 8 deletions

View file

@ -2,9 +2,9 @@
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
setImmediate(function() {
setTimeout(function() {
require('remote').getCurrentWindow().emit('onbeforeunload');
});
}, 0);
return false;
}
</script>

View file

@ -2,9 +2,9 @@
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
setImmediate(function() {
setTimeout(function() {
require('remote').getCurrentWindow().emit('onbeforeunload');
});
}, 0);
return false;
}
window.close();

View file

@ -2,9 +2,9 @@
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
setImmediate(function() {
setTimeout(function() {
require('remote').getCurrentWindow().emit('onbeforeunload');
});
}, 0);
return 'string';
}
window.close();

View file

@ -2,9 +2,9 @@
<body>
<script type="text/javascript" charset="utf-8">
window.onbeforeunload = function() {
setImmediate(function() {
setTimeout(function() {
require('remote').getCurrentWindow().emit('onbeforeunload');
});
}, 0);
return true;
}
window.close();