Clean up testing code written for crash for children

This commit is contained in:
Ramya Achutha Rao 2017-01-17 17:01:56 -08:00 коммит произвёл Kevin Sawicki
Родитель d453dbdb40
Коммит 241773f2f0
3 изменённых файлов: 2 добавлений и 57 удалений

Просмотреть файл

@ -1,4 +1,4 @@
const {app, BrowserWindow, crashReporter} = require('electron')
const {app, BrowserWindow} = require('electron')
const path = require('path')
let mainWindow = null
@ -20,11 +20,6 @@ exports.load = (appUrl) => {
if (process.platform === 'linux') {
options.icon = path.join(__dirname, 'icon.png')
}
crashReporter.start({
submitURL: 'http://localhost:8080/uploadDump/mainDump',
companyName: 'Main Company',
productName: 'Main Product'
})
mainWindow = new BrowserWindow(options)
mainWindow.loadURL(appUrl)

Просмотреть файл

@ -1,35 +0,0 @@
const os = require('os')
const path = require('path')
const {spawn} = require('child_process')
let submitURL = 'http://localhost:1127/post'
let productName = 'Child Product'
let companyName = 'Child Company'
let tmpPath = path.join(os.tmpdir(), productName + ' Crashes')
if (process.platform === 'win32') {
const args = [
'--reporter-url=' + submitURL,
'--application-name=' + productName,
'--crashes-directory=' + tmpPath
]
const env = {
ELECTRON_INTERNAL_CRASH_SERVICE: 1
}
spawn(process.execPath, args, {
env: env,
detached: true
})
}
process.crashReporter.start({
productName: productName,
companyName: companyName,
submitURL: submitURL,
crashesDirectory: tmpPath,
extra: {
randomData1: 'The Holidays are here!',
randomData2: 'Happy New Year!'
}
})
process.crash()

Просмотреть файл

@ -114,24 +114,11 @@
</head>
<body>
<script>
const {remote, shell, crashReporter} = require('electron');
const cp = require('child_process')
const {remote, shell} = require('electron');
const execPath = remote.process.execPath;
const command = execPath + ' path-to-your-app';
crashReporter.start({
productName: 'Renderer Product',
companyName: 'Renderer Company',
submitURL: 'http://localhost:8080/uploadDump/rendererDump'
});
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById('crashMe').addEventListener('click', () => {
cp.fork('./default_app/forkedProcess')
})
});
document.onclick = function(e) {
e.preventDefault();
if (e.target.tagName == 'A')
@ -170,8 +157,6 @@
<div class="container">
<button id="crashMe">Fork a process which crashes</button>
<p>
To run your app with Electron, execute the following command in your
Console (or Terminal):