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

This reverts commit 5d44b6a6a7.
This commit is contained in:
Anthony Dresser
2019-05-20 17:07:32 -07:00
committed by GitHub
parent 1315b8e42a
commit c9a4f8f664
325 changed files with 3332 additions and 4501 deletions

View File

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