@@ -423,6 +423,49 @@ suite('WorkingCopyBackupTracker (native)', function () {
423
423
await cleanup ( ) ;
424
424
} ) ;
425
425
426
+ test ( 'onWillShutdown - scratchpads - no veto if backed up' , async function ( ) {
427
+ const { accessor, cleanup } = await createTracker ( ) ;
428
+
429
+ class TestBackupWorkingCopy extends TestWorkingCopy {
430
+
431
+ constructor ( resource : URI ) {
432
+ super ( resource ) ;
433
+
434
+ accessor . workingCopyService . registerWorkingCopy ( this ) ;
435
+ }
436
+
437
+ override capabilities = WorkingCopyCapabilities . Untitled | WorkingCopyCapabilities . Scratchpad ;
438
+
439
+ override isDirty ( ) : boolean {
440
+ return false ;
441
+ }
442
+
443
+ override isModified ( ) : boolean {
444
+ return true ;
445
+ }
446
+ }
447
+
448
+ accessor . filesConfigurationService . testOnFilesConfigurationChange ( { files : { hotExit : HotExitConfiguration . ON_EXIT } } ) ;
449
+ accessor . nativeHostService . windowCount = Promise . resolve ( 2 ) ;
450
+ // Set cancel to force a veto if hot exit does not trigger
451
+ accessor . fileDialogService . setConfirmResult ( ConfirmResult . CANCEL ) ;
452
+
453
+ const resource = toResource . call ( this , '/path/custom.txt' ) ;
454
+ new TestBackupWorkingCopy ( resource ) ;
455
+
456
+ const event = new TestBeforeShutdownEvent ( ) ;
457
+ event . reason = ShutdownReason . CLOSE ;
458
+ accessor . lifecycleService . fireBeforeShutdown ( event ) ;
459
+
460
+ const veto = await event . value ;
461
+ assert . ok ( ! veto ) ;
462
+
463
+ const finalVeto = await event . finalValue ?.( ) ;
464
+ assert . ok ( ! finalVeto ) ; // assert the tracker uses the internal finalVeto API
465
+
466
+ await cleanup ( ) ;
467
+ } ) ;
468
+
426
469
test ( 'onWillShutdown - pending backup operations canceled and tracker suspended/resumsed' , async function ( ) {
427
470
const { accessor, tracker, cleanup } = await createTracker ( ) ;
428
471
0 commit comments