From d7ec0b99fdf37463599109dea7c78a01fe775125 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 7 Sep 2015 21:07:27 +0800 Subject: [PATCH] spec: process.stdout should not throw exception --- spec/node-spec.coffee | 4 ++++ spec/static/main.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/spec/node-spec.coffee b/spec/node-spec.coffee index 5ec2bb05e906..164480603e0f 100644 --- a/spec/node-spec.coffee +++ b/spec/node-spec.coffee @@ -133,3 +133,7 @@ describe 'node feature', -> b = new Buffer(p.innerText) assert.equal b.toString(), 'Jøhänñéß' assert.equal Buffer.byteLength(p.innerText), 13 + + describe 'process.stdout', -> + it 'should not throw exception', -> + process.stdout diff --git a/spec/static/main.js b/spec/static/main.js index d8b53167c5e2..1f6f9325e490 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -10,6 +10,11 @@ process.port = 0; // will be used by crash-reporter spec. app.commandLine.appendSwitch('js-flags', '--expose_gc'); app.commandLine.appendSwitch('ignore-certificate-errors'); +// Accessing stdout in the main process will result in the process.stdout +// throwing UnknownSystemError in renderer process sometimes. This line makes +// sure we can reproduce it in renderer process. +process.stdout; + ipc.on('message', function(event, arg) { event.sender.send('message', arg); });