Remove the closed event of Menu

The callback of Menu.popup does more things, and there is actually no
request for the closed event.
This commit is contained in:
Cheng Zhao 2018-01-01 17:22:07 +09:00
parent 73d78d345a
commit 46330ac2a9
6 changed files with 1 additions and 50 deletions

View file

@ -335,37 +335,6 @@ describe('Menu module', () => {
})
})
describe('Menu.closePopup()', () => {
let w = null
let menu
beforeEach((done) => {
w = new BrowserWindow({show: false, width: 200, height: 200})
menu = Menu.buildFromTemplate([
{
label: '1'
}
])
w.loadURL('data:text/html,<html>teszt</html>')
w.webContents.on('dom-ready', () => {
done()
})
})
afterEach(() => {
return closeWindow(w).then(() => { w = null })
})
it('emits closed event', (done) => {
menu.popup(w, {x: 100, y: 100})
menu.on('closed', () => {
done()
})
menu.closePopup(w)
})
})
describe('Menu.setApplicationMenu', () => {
it('sets a menu', () => {
const menu = Menu.buildFromTemplate([