Revert "Revert "Merge from vscode ada4bddb8edc69eea6ebaaa0e88c5f903cbd43d8 (#5529)" (#5553)" (#5562)

This reverts commit c9a4f8f664.
This commit is contained in:
Anthony Dresser
2019-05-21 14:19:32 -07:00
committed by GitHub
parent 7670104e4d
commit 81ae86ff79
325 changed files with 4497 additions and 3328 deletions

View File

@@ -86,7 +86,7 @@ class MyResourceInput extends ResourceEditorInput { }
suite('Workbench base editor', () => {
test('BaseEditor API', function () {
test('BaseEditor API', async () => {
let e = new MyEditor(NullTelemetryService);
let input = new MyOtherInput();
let options = new EditorOptions();
@@ -94,25 +94,24 @@ suite('Workbench base editor', () => {
assert(!e.isVisible());
assert(!e.input);
assert(!e.options);
return e.setInput(input, options, CancellationToken.None).then(() => {
assert.strictEqual(input, e.input);
assert.strictEqual(options, e.options);
const group = new TestEditorGroup(1);
e.setVisible(true, group);
assert(e.isVisible());
assert.equal(e.group, group);
input.onDispose(() => {
assert(false);
});
e.dispose();
e.clearInput();
e.setVisible(false, group);
assert(!e.isVisible());
assert(!e.input);
assert(!e.options);
assert(!e.getControl());
await e.setInput(input, options, CancellationToken.None);
assert.strictEqual(input, e.input);
assert.strictEqual(options, e.options);
const group = new TestEditorGroup(1);
e.setVisible(true, group);
assert(e.isVisible());
assert.equal(e.group, group);
input.onDispose(() => {
assert(false);
});
e.dispose();
e.clearInput();
e.setVisible(false, group);
assert(!e.isVisible());
assert(!e.input);
assert(!e.options);
assert(!e.getControl());
});
test('EditorDescriptor', () => {
@@ -154,10 +153,10 @@ suite('Workbench base editor', () => {
let inst = new TestInstantiationService();
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake'), undefined))!.instantiate(inst);
assert.strictEqual(editor.getId(), 'myEditor');
const otherEditor = EditorRegistry.getEditor(inst.createInstance(ResourceEditorInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
const otherEditor = EditorRegistry.getEditor(inst.createInstance(ResourceEditorInput, 'fake', '', URI.file('/fake'), undefined))!.instantiate(inst);
assert.strictEqual(otherEditor.getId(), 'myOtherEditor');
(<any>EditorRegistry).setEditors(oldEditors);
@@ -173,7 +172,7 @@ suite('Workbench base editor', () => {
let inst = new TestInstantiationService();
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake'), undefined))!.instantiate(inst);
assert.strictEqual('myOtherEditor', editor.getId());
(<any>EditorRegistry).setEditors(oldEditors);