diff --git a/front_end/Tests.js b/front_end/Tests.js index bf5890cda2..9bf1d38143 100644 --- a/front_end/Tests.js +++ b/front_end/Tests.js @@ -772,6 +772,23 @@ {type: 'rawKeyDown', key: 'F8', windowsVirtualKeyCode: 119, nativeVirtualKeyCode: 119}); }; + // Tests that the key whitelist in the browser is updated when shortcuts + // are changed + TestSuite.prototype.testKeyWhitelistChanged = function() { + this.takeControl(); + + this.addSniffer(self.UI.shortcutRegistry, '_registerBindings', () => { + self.SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent( + {type: 'rawKeyDown', key: 'F1', windowsVirtualKeyCode: 112, nativeVirtualKeyCode: 112}); + }); + this.addSniffer(self.UI.shortcutRegistry, 'handleKey', key => { + this.assertEquals(112, key); + this.releaseControl(); + }); + + self.Common.settings.moduleSetting('activeKeybindSet').set('vsCode'); + }; + TestSuite.prototype.testDispatchKeyEventDoesNotCrash = function() { self.SDK.targetManager.mainTarget().inputAgent().invoke_dispatchKeyEvent( {type: 'rawKeyDown', windowsVirtualKeyCode: 0x23, key: 'End'});