Check the upload parameters in crash-reporter spec.
This commit is contained in:
parent
cdb5e24d2f
commit
bd0836581b
2 changed files with 12 additions and 3 deletions
|
@ -8,6 +8,7 @@
|
||||||
"mocha": "~1.13.0",
|
"mocha": "~1.13.0",
|
||||||
"walkdir": "~0.0.7",
|
"walkdir": "~0.0.7",
|
||||||
|
|
||||||
|
"formidable": "~1.0.14",
|
||||||
"unzip": "~0.1.9",
|
"unzip": "~0.1.9",
|
||||||
"d3": "~3.3.8",
|
"d3": "~3.3.8",
|
||||||
"int64-native": "~0.2.0"
|
"int64-native": "~0.2.0"
|
||||||
|
|
|
@ -2,6 +2,7 @@ assert = require 'assert'
|
||||||
path = require 'path'
|
path = require 'path'
|
||||||
http = require 'http'
|
http = require 'http'
|
||||||
remote = require 'remote'
|
remote = require 'remote'
|
||||||
|
formidable = require 'formidable'
|
||||||
BrowserWindow = remote.require 'browser-window'
|
BrowserWindow = remote.require 'browser-window'
|
||||||
|
|
||||||
fixtures = path.resolve __dirname, '..', 'fixtures'
|
fixtures = path.resolve __dirname, '..', 'fixtures'
|
||||||
|
@ -10,8 +11,15 @@ describe 'crash-reporter module', ->
|
||||||
it 'should send minidump when renderer crashes', (done) ->
|
it 'should send minidump when renderer crashes', (done) ->
|
||||||
w = new BrowserWindow(show: false)
|
w = new BrowserWindow(show: false)
|
||||||
server = http.createServer (req, res) ->
|
server = http.createServer (req, res) ->
|
||||||
res.end()
|
form = new formidable.IncomingForm()
|
||||||
server.close()
|
form.parse req, (error, fields, files) ->
|
||||||
done()
|
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', ->
|
server.listen 901007, '127.0.0.1', ->
|
||||||
w.loadUrl 'file://' + path.join(fixtures, 'api', 'crash.html')
|
w.loadUrl 'file://' + path.join(fixtures, 'api', 'crash.html')
|
||||||
|
|
Loading…
Reference in a new issue