Merge pull request #9253 from electron/log-crashes-during-specs

Log all crashes during spec running
This commit is contained in:
Kevin Sawicki 2017-04-24 09:47:05 -07:00 committed by GitHub
commit 6c99d83b99

View file

@ -2,20 +2,15 @@
process.throwDeprecation = true process.throwDeprecation = true
const electron = require('electron') const electron = require('electron')
const app = electron.app const {app, BrowserWindow, crashReporter, dialog, ipcMain, protocol, webContents} = electron
const crashReporter = electron.crashReporter
const ipcMain = electron.ipcMain const {Coverage} = require('electabul')
const dialog = electron.dialog
const BrowserWindow = electron.BrowserWindow
const protocol = electron.protocol
const webContents = electron.webContents
const v8 = require('v8')
const Coverage = require('electabul').Coverage
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const url = require('url') const url = require('url')
const util = require('util') const util = require('util')
const v8 = require('v8')
var argv = require('yargs') var argv = require('yargs')
.boolean('ci') .boolean('ci')
@ -103,6 +98,12 @@ app.on('window-all-closed', function () {
app.quit() app.quit()
}) })
app.on('web-contents-created', (event, contents) => {
contents.on('crashed', (event, killed) => {
console.log(`webContents ${contents.id} crashed: ${contents.getURL()} (killed=${killed})`)
})
})
app.on('ready', function () { app.on('ready', function () {
// Test if using protocol module would crash. // Test if using protocol module would crash.
electron.protocol.registerStringProtocol('test-if-crashes', function () {}) electron.protocol.registerStringProtocol('test-if-crashes', function () {})