Fix dockMenu not being referenced in JavaScript (#12062)
* Fix dockMenu not being referenced in JavaScript * spec: Test garbage collecting dock menu
This commit is contained in:
parent
53229e3d6c
commit
35cbe9d140
2 changed files with 24 additions and 2 deletions
|
@ -7,7 +7,7 @@ const path = require('path')
|
|||
const {ipcRenderer, remote} = require('electron')
|
||||
const {closeWindow} = require('./window-helpers')
|
||||
|
||||
const {app, BrowserWindow, ipcMain} = remote
|
||||
const {app, BrowserWindow, Menu, ipcMain} = remote
|
||||
|
||||
const isCI = remote.getGlobal('isCi')
|
||||
|
||||
|
@ -881,4 +881,18 @@ describe('app module', () => {
|
|||
}, /before app is ready/)
|
||||
})
|
||||
})
|
||||
|
||||
describe('dock.setMenu', () => {
|
||||
before(function () {
|
||||
if (process.platform !== 'darwin') {
|
||||
this.skip()
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps references to the menu', () => {
|
||||
app.dock.setMenu(new Menu())
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
v8Util.requestGarbageCollectionForTesting()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue