diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index 411389497114f..97fa8d6d5e57d 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -28,7 +28,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { Registry } from 'vs/platform/registry/common/platform'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; -import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import { EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor'; export class TestEditorControl extends BaseEditor { @@ -308,100 +307,6 @@ suite('Editor service', () => { }); }); - test('close editor does not dispose when editor opened in other group (diff input)', function () { - const partInstantiator = workbenchInstantiationService(); - - const part = partInstantiator.createInstance(EditorPart, 'id', false); - part.create(document.createElement('div')); - part.layout(new Dimension(400, 300)); - - const testInstantiationService = partInstantiator.createChild(new ServiceCollection([IEditorGroupsService, part])); - - const service: IEditorService = testInstantiationService.createInstance(EditorService); - - const input = testInstantiationService.createInstance(TestEditorInput, URI.parse('my://resource')); - const otherInput = testInstantiationService.createInstance(TestEditorInput, URI.parse('my://resource2')); - const diffInput = new DiffEditorInput('name', 'description', input, otherInput); - - const rootGroup = part.activeGroup; - const rightGroup = part.addGroup(rootGroup, GroupDirection.RIGHT); - - // Open input - return service.openEditor(diffInput, { pinned: true }).then(editor => { - return service.openEditor(diffInput, { pinned: true }, rightGroup).then(editor => { - - // Close input - return rootGroup.closeEditor(diffInput).then(() => { - assert.equal(diffInput.isDisposed(), false); - assert.equal(input.isDisposed(), false); - assert.equal(otherInput.isDisposed(), false); - - return rightGroup.closeEditor(diffInput).then(() => { - assert.equal(diffInput.isDisposed(), true); - assert.equal(input.isDisposed(), true); - assert.equal(otherInput.isDisposed(), true); - }); - }); - }); - }); - }); - - test('close editor disposes properly (diff input)', function () { - const partInstantiator = workbenchInstantiationService(); - - const part = partInstantiator.createInstance(EditorPart, 'id', false); - part.create(document.createElement('div')); - part.layout(new Dimension(400, 300)); - - const testInstantiationService = partInstantiator.createChild(new ServiceCollection([IEditorGroupsService, part])); - - const service: IEditorService = testInstantiationService.createInstance(EditorService); - - const input = testInstantiationService.createInstance(TestEditorInput, URI.parse('my://resource')); - const otherInput = testInstantiationService.createInstance(TestEditorInput, URI.parse('my://resource2')); - const diffInput = new DiffEditorInput('name', 'description', input, otherInput); - - // Open input - return service.openEditor(diffInput, { pinned: true }).then(editor => { - - // Close input - return editor.group.closeEditor(diffInput).then(() => { - assert.equal(diffInput.isDisposed(), true); - assert.equal(otherInput.isDisposed(), true); - assert.equal(input.isDisposed(), true); - }); - }); - }); - - test('close editor disposes properly (diff input, left side still opened)', function () { - const partInstantiator = workbenchInstantiationService(); - - const part = partInstantiator.createInstance(EditorPart, 'id', false); - part.create(document.createElement('div')); - part.layout(new Dimension(400, 300)); - - const testInstantiationService = partInstantiator.createChild(new ServiceCollection([IEditorGroupsService, part])); - - const service: IEditorService = testInstantiationService.createInstance(EditorService); - - const input = testInstantiationService.createInstance(TestEditorInput, URI.parse('my://resource')); - const otherInput = testInstantiationService.createInstance(TestEditorInput, URI.parse('my://resource2')); - const diffInput = new DiffEditorInput('name', 'description', input, otherInput); - - // Open input - return service.openEditor(diffInput, { pinned: true }).then(editor => { - return service.openEditor(input, { pinned: true }).then(editor => { - - // Close input - return editor.group.closeEditor(diffInput).then(() => { - assert.equal(diffInput.isDisposed(), true); - assert.equal(otherInput.isDisposed(), true); - assert.equal(input.isDisposed(), false); - }); - }); - }); - }); - test('open to the side', function () { const partInstantiator = workbenchInstantiationService();