]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: process.stdout should not throw exception
authorCheng Zhao <zcbenz@gmail.com>
Mon, 7 Sep 2015 13:07:27 +0000 (21:07 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 7 Sep 2015 13:37:17 +0000 (21:37 +0800)
spec/node-spec.coffee
spec/static/main.js

index 5ec2bb05e906d59f24e4eb6a5803c9f4a8c99618..164480603e0ff0e80b5b8638591d177f5bda5d32 100644 (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
index d8b53167c5e2c53a4a952f99490585083b88c216..1f6f9325e49056574c53849c7cf1f5083fbce370 100644 (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);
 });