@@ -28,7 +28,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
28
28
import { Registry } from 'vs/platform/registry/common/platform' ;
29
29
import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput' ;
30
30
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput' ;
31
- import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput' ;
32
31
import { EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor' ;
33
32
34
33
export class TestEditorControl extends BaseEditor {
@@ -308,100 +307,6 @@ suite('Editor service', () => {
308
307
} ) ;
309
308
} ) ;
310
309
311
- test ( 'close editor does not dispose when editor opened in other group (diff input)' , function ( ) {
312
- const partInstantiator = workbenchInstantiationService ( ) ;
313
-
314
- const part = partInstantiator . createInstance ( EditorPart , 'id' , false ) ;
315
- part . create ( document . createElement ( 'div' ) ) ;
316
- part . layout ( new Dimension ( 400 , 300 ) ) ;
317
-
318
- const testInstantiationService = partInstantiator . createChild ( new ServiceCollection ( [ IEditorGroupsService , part ] ) ) ;
319
-
320
- const service : IEditorService = testInstantiationService . createInstance ( EditorService ) ;
321
-
322
- const input = testInstantiationService . createInstance ( TestEditorInput , URI . parse ( 'my://resource' ) ) ;
323
- const otherInput = testInstantiationService . createInstance ( TestEditorInput , URI . parse ( 'my://resource2' ) ) ;
324
- const diffInput = new DiffEditorInput ( 'name' , 'description' , input , otherInput ) ;
325
-
326
- const rootGroup = part . activeGroup ;
327
- const rightGroup = part . addGroup ( rootGroup , GroupDirection . RIGHT ) ;
328
-
329
- // Open input
330
- return service . openEditor ( diffInput , { pinned : true } ) . then ( editor => {
331
- return service . openEditor ( diffInput , { pinned : true } , rightGroup ) . then ( editor => {
332
-
333
- // Close input
334
- return rootGroup . closeEditor ( diffInput ) . then ( ( ) => {
335
- assert . equal ( diffInput . isDisposed ( ) , false ) ;
336
- assert . equal ( input . isDisposed ( ) , false ) ;
337
- assert . equal ( otherInput . isDisposed ( ) , false ) ;
338
-
339
- return rightGroup . closeEditor ( diffInput ) . then ( ( ) => {
340
- assert . equal ( diffInput . isDisposed ( ) , true ) ;
341
- assert . equal ( input . isDisposed ( ) , true ) ;
342
- assert . equal ( otherInput . isDisposed ( ) , true ) ;
343
- } ) ;
344
- } ) ;
345
- } ) ;
346
- } ) ;
347
- } ) ;
348
-
349
- test ( 'close editor disposes properly (diff input)' , function ( ) {
350
- const partInstantiator = workbenchInstantiationService ( ) ;
351
-
352
- const part = partInstantiator . createInstance ( EditorPart , 'id' , false ) ;
353
- part . create ( document . createElement ( 'div' ) ) ;
354
- part . layout ( new Dimension ( 400 , 300 ) ) ;
355
-
356
- const testInstantiationService = partInstantiator . createChild ( new ServiceCollection ( [ IEditorGroupsService , part ] ) ) ;
357
-
358
- const service : IEditorService = testInstantiationService . createInstance ( EditorService ) ;
359
-
360
- const input = testInstantiationService . createInstance ( TestEditorInput , URI . parse ( 'my://resource' ) ) ;
361
- const otherInput = testInstantiationService . createInstance ( TestEditorInput , URI . parse ( 'my://resource2' ) ) ;
362
- const diffInput = new DiffEditorInput ( 'name' , 'description' , input , otherInput ) ;
363
-
364
- // Open input
365
- return service . openEditor ( diffInput , { pinned : true } ) . then ( editor => {
366
-
367
- // Close input
368
- return editor . group . closeEditor ( diffInput ) . then ( ( ) => {
369
- assert . equal ( diffInput . isDisposed ( ) , true ) ;
370
- assert . equal ( otherInput . isDisposed ( ) , true ) ;
371
- assert . equal ( input . isDisposed ( ) , true ) ;
372
- } ) ;
373
- } ) ;
374
- } ) ;
375
-
376
- test ( 'close editor disposes properly (diff input, left side still opened)' , function ( ) {
377
- const partInstantiator = workbenchInstantiationService ( ) ;
378
-
379
- const part = partInstantiator . createInstance ( EditorPart , 'id' , false ) ;
380
- part . create ( document . createElement ( 'div' ) ) ;
381
- part . layout ( new Dimension ( 400 , 300 ) ) ;
382
-
383
- const testInstantiationService = partInstantiator . createChild ( new ServiceCollection ( [ IEditorGroupsService , part ] ) ) ;
384
-
385
- const service : IEditorService = testInstantiationService . createInstance ( EditorService ) ;
386
-
387
- const input = testInstantiationService . createInstance ( TestEditorInput , URI . parse ( 'my://resource' ) ) ;
388
- const otherInput = testInstantiationService . createInstance ( TestEditorInput , URI . parse ( 'my://resource2' ) ) ;
389
- const diffInput = new DiffEditorInput ( 'name' , 'description' , input , otherInput ) ;
390
-
391
- // Open input
392
- return service . openEditor ( diffInput , { pinned : true } ) . then ( editor => {
393
- return service . openEditor ( input , { pinned : true } ) . then ( editor => {
394
-
395
- // Close input
396
- return editor . group . closeEditor ( diffInput ) . then ( ( ) => {
397
- assert . equal ( diffInput . isDisposed ( ) , true ) ;
398
- assert . equal ( otherInput . isDisposed ( ) , true ) ;
399
- assert . equal ( input . isDisposed ( ) , false ) ;
400
- } ) ;
401
- } ) ;
402
- } ) ;
403
- } ) ;
404
-
405
310
test ( 'open to the side' , function ( ) {
406
311
const partInstantiator = workbenchInstantiationService ( ) ;
407
312
0 commit comments