fix: volume key globalShortcut registration (#23782)
This commit is contained in:
parent
3a7775fa73
commit
6516110c70
3 changed files with 39 additions and 13 deletions
|
@ -38,4 +38,21 @@ ifdescribe(process.platform !== 'win32')('globalShortcut module', () => {
|
|||
expect(globalShortcut.isRegistered(accelerators[0])).to.be.false('first unregistered');
|
||||
expect(globalShortcut.isRegistered(accelerators[1])).to.be.false('second unregistered');
|
||||
});
|
||||
|
||||
it('does not crash when registering media keys as global shortcuts', () => {
|
||||
const accelerators = [
|
||||
'VolumeUp',
|
||||
'VolumeDown',
|
||||
'VolumeMute',
|
||||
'MediaNextTrack',
|
||||
'MediaPreviousTrack',
|
||||
'MediaStop', 'MediaPlayPause'
|
||||
];
|
||||
|
||||
expect(() => {
|
||||
globalShortcut.registerAll(accelerators, () => {});
|
||||
}).to.not.throw();
|
||||
|
||||
globalShortcut.unregisterAll();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue