Clean up testing code written for crash for children
This commit is contained in:
parent
d453dbdb40
commit
241773f2f0
3 changed files with 2 additions and 57 deletions
|
@ -1,4 +1,4 @@
|
||||||
const {app, BrowserWindow, crashReporter} = require('electron')
|
const {app, BrowserWindow} = require('electron')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
let mainWindow = null
|
let mainWindow = null
|
||||||
|
@ -20,11 +20,6 @@ exports.load = (appUrl) => {
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
options.icon = path.join(__dirname, 'icon.png')
|
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 = new BrowserWindow(options)
|
||||||
mainWindow.loadURL(appUrl)
|
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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
const {remote, shell, crashReporter} = require('electron');
|
const {remote, shell} = require('electron');
|
||||||
const cp = require('child_process')
|
|
||||||
|
|
||||||
const execPath = remote.process.execPath;
|
const execPath = remote.process.execPath;
|
||||||
const command = execPath + ' path-to-your-app';
|
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) {
|
document.onclick = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (e.target.tagName == 'A')
|
if (e.target.tagName == 'A')
|
||||||
|
@ -170,8 +157,6 @@
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<button id="crashMe">Fork a process which crashes</button>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To run your app with Electron, execute the following command in your
|
To run your app with Electron, execute the following command in your
|
||||||
Console (or Terminal):
|
Console (or Terminal):
|
||||||
|
|
Loading…
Reference in a new issue