]> khamidou — GitHub mirrors - electron.git/commitdiff
Add spec for #481.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 02:29:26 +0000 (10:29 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 02:37:38 +0000 (10:37 +0800)
spec/node-spec.coffee

index 6b63f9ceae17ef0230ec148d8780e47a8335c979..e05aac7d45538dfd4f07c21a22c8fd4b71e24c5f 100644 (file)
@@ -3,6 +3,7 @@ child_process = require 'child_process'
 fs            = require 'fs'
 path          = require 'path'
 os            = require 'os'
+remote        = require 'remote'
 
 describe 'node feature', ->
   fixtures = path.join __dirname, 'fixtures'
@@ -33,7 +34,7 @@ describe 'node feature', ->
         child.send 'message'
 
       it 'works in browser process', (done) ->
-        fork = require('remote').require('child_process').fork
+        fork = remote.require('child_process').fork
         child = fork path.join(fixtures, 'module', 'ping.js')
         child.on 'message', (msg) ->
           assert.equal msg, 'message'
@@ -64,6 +65,10 @@ describe 'node feature', ->
         fs.readFile __filename, ->
           throw error
 
+    describe 'setTimeout called under Chromium event loop in browser process', ->
+      it 'can be scheduled in time', (done) ->
+        remote.getGlobal('setTimeout')(done, 0)
+
   describe 'message loop', ->
     describe 'process.nextTick', ->
       it 'emits the callback', (done) ->