Add spec for crash-reporter
This commit is contained in:
parent
6b02be6da8
commit
cdb5e24d2f
2 changed files with 31 additions and 0 deletions
17
spec/api/crash-reporter.coffee
Normal file
17
spec/api/crash-reporter.coffee
Normal file
|
@ -0,0 +1,17 @@
|
|||
assert = require 'assert'
|
||||
path = require 'path'
|
||||
http = require 'http'
|
||||
remote = require 'remote'
|
||||
BrowserWindow = remote.require 'browser-window'
|
||||
|
||||
fixtures = path.resolve __dirname, '..', 'fixtures'
|
||||
|
||||
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()
|
||||
server.listen 901007, '127.0.0.1', ->
|
||||
w.loadUrl 'file://' + path.join(fixtures, 'api', 'crash.html')
|
14
spec/fixtures/api/crash.html
vendored
Normal file
14
spec/fixtures/api/crash.html
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
var crashReporter = require('crash-reporter');
|
||||
crashReporter.start({
|
||||
submitUrl: 'http://127.0.0.1:901007',
|
||||
autoSubmit: true,
|
||||
ignoreSystemCrashHandler: true
|
||||
});
|
||||
|
||||
setImmediate(function() { process.crash(); });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue