mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode c873727e8bac95e7cbf5b154a9e6ae0986f2ce18 (#6446)
This commit is contained in:
@@ -12,33 +12,39 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TestStorageService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
|
||||
class TestKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
|
||||
constructor(notificationService: INotificationService, storageService: IStorageService, commandService: ICommandService) {
|
||||
super(notificationService, storageService, commandService);
|
||||
|
||||
let keymapInfos: IKeymapInfo[] = KeyboardLayoutContribution.INSTANCE.layoutInfos;
|
||||
const keymapInfos: IKeymapInfo[] = KeyboardLayoutContribution.INSTANCE.layoutInfos;
|
||||
this._keymapInfos.push(...keymapInfos.map(info => (new KeymapInfo(info.layout, info.secondaryLayouts, info.mapping, info.isUserKeyboardLayout))));
|
||||
this._mru = this._keymapInfos;
|
||||
this._initialized = true;
|
||||
this.onKeyboardLayoutChanged();
|
||||
const usLayout = this.getUSStandardLayout();
|
||||
if (usLayout) {
|
||||
this.setActiveKeyMapping(usLayout.mapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
suite('keyboard layout loader', () => {
|
||||
let instantiationService: TestInstantiationService = new TestInstantiationService();
|
||||
let notitifcationService = instantiationService.stub(INotificationService, {});
|
||||
let storageService = instantiationService.stub(IStorageService, {});
|
||||
let notitifcationService = instantiationService.stub(INotificationService, new TestNotificationService());
|
||||
let storageService = instantiationService.stub(IStorageService, new TestStorageService());
|
||||
|
||||
let commandService = instantiationService.stub(ICommandService, {});
|
||||
let instance = new TestKeyboardMapperFactory(notitifcationService, storageService, commandService);
|
||||
|
||||
test.skip('load default US keyboard layout', () => {
|
||||
test('load default US keyboard layout', () => {
|
||||
assert.notEqual(instance.activeKeyboardLayout, null);
|
||||
assert.equal(instance.activeKeyboardLayout!.isUSStandard, true);
|
||||
});
|
||||
|
||||
test.skip('isKeyMappingActive', () => {
|
||||
test('isKeyMappingActive', () => {
|
||||
assert.equal(instance.isKeyMappingActive({
|
||||
KeyA: {
|
||||
value: 'a',
|
||||
|
||||
Reference in New Issue
Block a user