Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: address TODO for app.makeSingleInstance / releaseSingleInstance removal #14518

Merged
merged 1 commit into from Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 0 additions & 15 deletions lib/browser/api/app.js
Expand Up @@ -107,21 +107,6 @@ for (let name of events) {
})
}

// TODO(MarshallOfSound): Remove in 4.0
app.releaseSingleInstance = () => {
deprecate.warn('app.releaseSingleInstance(cb)', 'app.releaseSingleInstanceLock()')
app.releaseSingleInstanceLock()
}

// TODO(MarshallOfSound): Remove in 4.0
app.makeSingleInstance = (oldStyleFn) => {
deprecate.warn('app.makeSingleInstance(cb)', 'app.requestSingleInstanceLock() and app.on(\'second-instance\', cb)')
if (oldStyleFn && typeof oldStyleFn === 'function') {
app.on('second-instance', (event, ...args) => oldStyleFn(...args))
}
return !app.requestSingleInstanceLock()
}

// Wrappers for native classes.
const {DownloadItem} = process.atomBinding('download_item')
Object.setPrototypeOf(DownloadItem.prototype, EventEmitter.prototype)
22 changes: 0 additions & 22 deletions spec/api-app-spec.js
Expand Up @@ -202,28 +202,6 @@ describe('app module', () => {
})
})

// TODO(MarshallOfSound) - Remove in 4.0.0
describe('app.makeSingleInstance', () => {
it('prevents the second launch of app', function (done) {
this.timeout(120000)
const appPath = path.join(__dirname, 'fixtures', 'api', 'singleton-old')
// First launch should exit with 0.
const first = ChildProcess.spawn(remote.process.execPath, [appPath])
first.once('exit', code => {
expect(code).to.equal(0)
})
// Start second app when received output.
first.stdout.once('data', () => {
// Second launch should exit with 1.
const second = ChildProcess.spawn(remote.process.execPath, [appPath])
second.once('exit', code => {
expect(code).to.equal(1)
done()
})
})
})
})

describe('app.requestSingleInstanceLock', () => {
it('prevents the second launch of app', function (done) {
this.timeout(120000)
Expand Down
13 changes: 0 additions & 13 deletions spec/fixtures/api/singleton-old/main.js

This file was deleted.

5 changes: 0 additions & 5 deletions spec/fixtures/api/singleton-old/package.json

This file was deleted.