diff --git a/package.json b/package.json index c68e6d16f457..b063dadd2d0f 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "mocha": "~1.13.0", "walkdir": "~0.0.7", + "formidable": "~1.0.14", "unzip": "~0.1.9", "d3": "~3.3.8", "int64-native": "~0.2.0" diff --git a/spec/api/crash-reporter.coffee b/spec/api/crash-reporter.coffee index 9e09a70e9981..e6ad559951ea 100644 --- a/spec/api/crash-reporter.coffee +++ b/spec/api/crash-reporter.coffee @@ -2,6 +2,7 @@ assert = require 'assert' path = require 'path' http = require 'http' remote = require 'remote' +formidable = require 'formidable' BrowserWindow = remote.require 'browser-window' fixtures = path.resolve __dirname, '..', 'fixtures' @@ -10,8 +11,15 @@ describe 'crash-reporter module', -> it 'should send minidump when renderer crashes', (done) -> w = new BrowserWindow(show: false) server = http.createServer (req, res) -> - res.end() - server.close() - done() + form = new formidable.IncomingForm() + form.parse req, (error, fields, files) -> + assert.equal fields['atom_shell_version'], process.versions['atom-shell'] + assert.equal fields['process_type'], 'renderer' + assert.equal files['upload_file_minidump']['name'], 'minidump.dmp' + + w.destroy() + res.end() + server.close() + done() server.listen 901007, '127.0.0.1', -> w.loadUrl 'file://' + path.join(fixtures, 'api', 'crash.html')