spec: process.stdout should not throw exception

This commit is contained in:
Cheng Zhao 2015-09-07 21:07:27 +08:00
parent 87e02f2858
commit d7ec0b99fd
2 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -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);
});