From: Cheng Zhao Date: Fri, 15 Nov 2013 02:37:22 +0000 (+0800) Subject: Check the upload parameters in crash-reporter spec. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd0836581bbfbba584ed2c869a956663d62de234;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Check the upload parameters in crash-reporter spec. --- diff --git a/package.json b/package.json index c68e6d1..b063dad 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 9e09a70..e6ad559 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')