chore: remove promisification deprecation callbacks (#17907)

* chore: remove promisification deprecation callbacks

* update docs

* fix smoke test

* fix executejs issue

* cleanup leftovers

* fix webContents.executeJavaScript tests

* cleanup WebContents.prototype.takeHeapSnapshot

* fix "sets arbitrary webContents as devtools" test

* fix executeJavaScriptInFrame related tests
This commit is contained in:
Shelley Vohr 2019-04-30 07:08:33 -07:00 committed by John Kleinschmidt
parent fdf5f838f4
commit d87b3ead76
44 changed files with 94 additions and 1418 deletions

View file

@ -412,7 +412,7 @@ describe('app module', () => {
await w.loadURL('about:blank')
const promise = emittedOnce(app, 'desktop-capturer-get-sources')
w.webContents.executeJavaScript(`require('electron').desktopCapturer.getSources({ types: ['screen'] }, () => {})`)
w.webContents.executeJavaScript(`require('electron').desktopCapturer.getSources({ types: ['screen'] })`)
const [, webContents] = await promise
expect(webContents).to.equal(w.webContents)
@ -856,15 +856,6 @@ describe('app module', () => {
expect(icon.isEmpty()).to.equal(false)
})
// TODO(codebytere): remove when promisification is complete
it('fetches a non-empty icon (callback)', (done) => {
app.getFileIcon(iconPath, (error, icon) => {
expect(error).to.equal(null)
expect(icon.isEmpty()).to.equal(false)
done()
})
})
it('fetches normal icon size by default', async () => {
const icon = await app.getFileIcon(iconPath)
const size = icon.getSize()
@ -873,18 +864,6 @@ describe('app module', () => {
expect(size.width).to.equal(sizes.normal)
})
// TODO(codebytere): remove when promisification is complete
it('fetches normal icon size by default (callback)', (done) => {
app.getFileIcon(iconPath, (error, icon) => {
expect(error).to.equal(null)
const size = icon.getSize()
expect(size.height).to.equal(sizes.normal)
expect(size.width).to.equal(sizes.normal)
done()
})
})
describe('size option', () => {
it('fetches a small icon', async () => {
const icon = await app.getFileIcon(iconPath, { size: 'small' })
@ -902,18 +881,6 @@ describe('app module', () => {
expect(size.width).to.equal(sizes.normal)
})
// TODO(codebytere): remove when promisification is complete
it('fetches a normal icon (callback)', (done) => {
app.getFileIcon(iconPath, { size: 'normal' }, (error, icon) => {
expect(error).to.equal(null)
const size = icon.getSize()
expect(size.height).to.equal(sizes.normal)
expect(size.width).to.equal(sizes.normal)
done()
})
})
it('fetches a large icon', async () => {
// macOS does not support large icons
if (process.platform === 'darwin') return