From: Cheng Zhao Date: Wed, 4 Feb 2015 18:52:09 +0000 (-0800) Subject: spec: Script forked with child_process supports asar archives X-Git-Tag: v0.21.2~5^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f214e887843e0982adccf125a771a95b80126a51;p=electron.git spec: Script forked with child_process supports asar archives --- diff --git a/spec/asar-spec.coffee b/spec/asar-spec.coffee index ae0526f9..ab96d7ee 100644 --- a/spec/asar-spec.coffee +++ b/spec/asar-spec.coffee @@ -347,6 +347,14 @@ describe 'asar package', -> throws = -> child_process.fork p assert.throws throws, /ENOENT/ + it 'supports asar in the forked js', (done) -> + file = path.join fixtures, 'asar', 'a.asar', 'file1' + child = child_process.fork path.join(fixtures, 'module', 'asar.js') + child.on 'message', (content) -> + assert.equal content, fs.readFileSync(file).toString() + done() + child.send file + describe 'asar protocol', -> url = require 'url' remote = require 'remote' diff --git a/spec/fixtures/module/asar.js b/spec/fixtures/module/asar.js new file mode 100644 index 00000000..1fb87508 --- /dev/null +++ b/spec/fixtures/module/asar.js @@ -0,0 +1,4 @@ +var fs = require('fs'); +process.on('message', function(file) { + process.send(fs.readFileSync(file).toString()); +});