]> khamidou — GitHub mirrors - electron.git/commitdiff
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 06a2ecf804ec43bd40d33e30dfc279015fc7dac6..b5a04781103aafd114b1d99e77097565e23c077e 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 d8e4f1f5817ab70f16ca9202f0e58e684e0838e2..a3c40287df15877993309d85dd8733506d58d60f 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 c4fc0baa592cd5a61227ef72948d75086849b63a..aae08a3560a4d1cf31cc43a0938cd19e6354e79a 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 667afbb3d3d7da96c30a14de4df9d1ec23f6c315..0a550b4258f4b903d73e70e13718326230118e56 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();