mirror of
https://github.com/electron/electron.git
synced 2026-02-04 12:15:22 -05:00
fix: don't crash on tray.setContextMenu(null) (#14322)
This commit is contained in:
committed by
Charles Kerr
parent
fd27d75129
commit
a08ca9defb
25
spec/api-tray-spec.js
Normal file
25
spec/api-tray-spec.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const {remote} = require('electron')
|
||||
const {Menu, Tray, nativeImage} = remote
|
||||
|
||||
describe('tray module', () => {
|
||||
describe('tray.setContextMenu', () => {
|
||||
let tray
|
||||
|
||||
beforeEach(() => {
|
||||
tray = new Tray(nativeImage.createEmpty())
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
tray.destroy()
|
||||
tray = null
|
||||
})
|
||||
|
||||
it('accepts menu instance', () => {
|
||||
tray.setContextMenu(new Menu())
|
||||
})
|
||||
|
||||
it('accepts null', () => {
|
||||
tray.setContextMenu(null)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user