Use setTimeout instead of setImmediate in fixtures.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 2 Sep 2013 08:46:08 +0000 (16:46 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 2 Sep 2013 08:46:08 +0000 (16:46 +0800)
The setImmediate is implemented in node and may have unexpected affects.

spec/fixtures/api/beforeunload-false.html
spec/fixtures/api/close-beforeunload-false.html
spec/fixtures/api/close-beforeunload-string.html
spec/fixtures/api/close-beforeunload-true.html

index 06a2ecf..b5a0478 100644 (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>
index d8e4f1f..a3c4028 100644 (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();
index c4fc0ba..aae08a3 100644 (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();
index 667afbb..0a550b4 100644 (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();