update deprecation warning
This commit is contained in:
parent
3af83f1c97
commit
24acd74d15
3 changed files with 8 additions and 6 deletions
|
@ -31,7 +31,7 @@ struct Converter<CrashReporter::UploadReportResult> {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// TODO(2.0) Deprecate
|
// TODO(2.0) Remove
|
||||||
void SetExtraParameter(const std::string& key, mate::Arguments* args) {
|
void SetExtraParameter(const std::string& key, mate::Arguments* args) {
|
||||||
std::string value;
|
std::string value;
|
||||||
if (args->GetNext(&value))
|
if (args->GetNext(&value))
|
||||||
|
|
|
@ -4,7 +4,7 @@ const {spawn} = require('child_process')
|
||||||
const os = require('os')
|
const os = require('os')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const {app} = process.type === 'browser' ? electron : electron.remote
|
const {app, deprecate} = process.type === 'browser' ? electron : electron.remote
|
||||||
const binding = process.atomBinding('crash_reporter')
|
const binding = process.atomBinding('crash_reporter')
|
||||||
|
|
||||||
class CrashReporter {
|
class CrashReporter {
|
||||||
|
@ -104,8 +104,10 @@ class CrashReporter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(2.0) Deprecate
|
// TODO(2.0) Remove
|
||||||
setExtraParameter (key, value) {
|
setExtraParameter (key, value) {
|
||||||
|
deprecate.warn('crashReporter.setExtraParameter',
|
||||||
|
'crashReporter.addExtraParameter or crashReporter.removeExtraParameter')
|
||||||
binding.setExtraParameter(key, value)
|
binding.setExtraParameter(key, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ const {closeWindow} = require('./window-helpers')
|
||||||
const {remote} = require('electron')
|
const {remote} = require('electron')
|
||||||
const {app, BrowserWindow, crashReporter} = remote.require('electron')
|
const {app, BrowserWindow, crashReporter} = remote.require('electron')
|
||||||
|
|
||||||
describe.only('crashReporter module', () => {
|
describe('crashReporter module', () => {
|
||||||
if (process.mas || process.env.DISABLE_CRASH_REPORTER_TESTS) return
|
if (process.mas || process.env.DISABLE_CRASH_REPORTER_TESTS) return
|
||||||
|
|
||||||
let originalTempDirectory = null
|
let originalTempDirectory = null
|
||||||
|
@ -328,7 +328,7 @@ describe.only('crashReporter module', () => {
|
||||||
const parameters = crashReporter.getParameters()
|
const parameters = crashReporter.getParameters()
|
||||||
assert(typeof parameters === 'object')
|
assert(typeof parameters === 'object')
|
||||||
})
|
})
|
||||||
// TODO(2.0) deprecate
|
// TODO(2.0) Remove
|
||||||
it('adds a parameter with setExtraParameter', () => {
|
it('adds a parameter with setExtraParameter', () => {
|
||||||
// only run on MacOS
|
// only run on MacOS
|
||||||
if (process.platform !== 'darwin') return
|
if (process.platform !== 'darwin') return
|
||||||
|
@ -353,7 +353,7 @@ describe.only('crashReporter module', () => {
|
||||||
crashReporter.addExtraParameter('hello', 'world')
|
crashReporter.addExtraParameter('hello', 'world')
|
||||||
assert('hello' in crashReporter.getParameters())
|
assert('hello' in crashReporter.getParameters())
|
||||||
})
|
})
|
||||||
// TODO(2.0) deprecate
|
// TODO(2.0) Remove
|
||||||
it('removes a parameter with setExtraParameter', () => {
|
it('removes a parameter with setExtraParameter', () => {
|
||||||
// only run on MacOS
|
// only run on MacOS
|
||||||
if (process.platform !== 'darwin') return
|
if (process.platform !== 'darwin') return
|
||||||
|
|
Loading…
Reference in a new issue