From 53cedc6e5da7fbe77fc76142b2d03b9b817b9a74 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 7 Aug 2014 10:29:26 +0800 Subject: [PATCH] Add spec for #481. --- spec/node-spec.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/node-spec.coffee b/spec/node-spec.coffee index 6b63f9ceae1..e05aac7d455 100644 --- a/spec/node-spec.coffee +++ b/spec/node-spec.coffee @@ -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) ->