Also upload product name, company name and version in crash report.

This commit is contained in:
Cheng Zhao 2013-11-26 10:19:50 +08:00
parent 1fc9ef33db
commit 151b2b5ad5
3 changed files with 13 additions and 1 deletions

View file

@ -12,6 +12,14 @@ class CrashReporter
ignoreSystemCrashHandler ?= false ignoreSystemCrashHandler ?= false
extra ?= {} extra ?= {}
extra._productName ?= productName
extra._companyName ?= companyName
extra._version ?=
if process.__atom_type is 'browser'
require('app').getVersion()
else
require('remote').require('app').getVersion()
start = -> binding.start productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra start = -> binding.start productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra
if process.platform is 'darwin' if process.platform is 'darwin'

View file

@ -19,6 +19,9 @@ describe 'crash-reporter module', ->
assert.equal fields['platform'], process.platform assert.equal fields['platform'], process.platform
assert.equal fields['extra1'], 'extra1' assert.equal fields['extra1'], 'extra1'
assert.equal fields['extra2'], 'extra2' assert.equal fields['extra2'], 'extra2'
assert.equal fields['_productName'], 'Zombies'
assert.equal fields['_companyName'], 'Umbrella Corporation'
assert.equal fields['_version'], require('remote').require('app').getVersion()
assert files['upload_file_minidump']['name']? assert files['upload_file_minidump']['name']?
w.destroy() w.destroy()

View file

@ -3,7 +3,8 @@
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
var crashReporter = require('crash-reporter'); var crashReporter = require('crash-reporter');
crashReporter.start({ crashReporter.start({
productName: 'Something other than Atom-Shell', productName: 'Zombies',
companyName: 'Umbrella Corporation',
submitUrl: 'http://127.0.0.1:1127', submitUrl: 'http://127.0.0.1:1127',
autoSubmit: true, autoSubmit: true,
ignoreSystemCrashHandler: true, ignoreSystemCrashHandler: true,