@@ -588,16 +588,13 @@ transforms: []
588
588
notAnalyzed: [testFile.path],
589
589
);
590
590
591
- // Ask to remove the overlay, still active, start a timer .
591
+ // Remove the overlay, now the file will be read .
592
592
await handleSuccessfulRequest (
593
593
AnalysisUpdateContentParams ({
594
594
testFile.path: RemoveContentOverlay (),
595
595
}).toRequest ('0' ),
596
596
);
597
597
598
- // Wait for the timer to remove the overlay to fire.
599
- await Future .delayed (server.pendingFilesRemoveOverlayDelay);
600
-
601
598
// The file has errors.
602
599
await _waitAnalysisComplete ();
603
600
_assertAnalyzedFiles (
@@ -607,66 +604,6 @@ transforms: []
607
604
);
608
605
}
609
606
610
- Future <void >
611
- test_fileSystem_changeFile_hasOverlay_removeOverlay_delayed () async {
612
- // Use long delay, so that it does not happen.
613
- server.pendingFilesRemoveOverlayDelay = const Duration (seconds: 300 );
614
-
615
- newFile (testFilePath, '' );
616
-
617
- // Add an overlay without errors.
618
- await handleSuccessfulRequest (
619
- AnalysisUpdateContentParams ({
620
- testFile.path: AddContentOverlay ('' ),
621
- }).toRequest ('0' ),
622
- );
623
-
624
- await setRoots (included: [workspaceRootPath], excluded: []);
625
-
626
- // The test file (overlay) is analyzed, no errors.
627
- await _waitAnalysisComplete ();
628
- _assertAnalyzedFiles (
629
- hasErrors: [],
630
- noErrors: [testFile.path],
631
- notAnalyzed: [],
632
- );
633
-
634
- // Change the file, has errors.
635
- modifyFile (testFilePath, 'error' );
636
-
637
- // But the overlay is still present, so the file is not analyzed.
638
- await _waitAnalysisComplete ();
639
- _assertAnalyzedFiles (
640
- hasErrors: [],
641
- notAnalyzed: [testFile.path],
642
- );
643
-
644
- // Ask to remove the overlay, still active, start a timer.
645
- await handleSuccessfulRequest (
646
- AnalysisUpdateContentParams ({
647
- testFile.path: RemoveContentOverlay (),
648
- }).toRequest ('0' ),
649
- );
650
-
651
- // Long timer, so still not analyzed.
652
- await _waitAnalysisComplete ();
653
- _assertAnalyzedFiles (
654
- hasErrors: [],
655
- notAnalyzed: [testFile.path],
656
- );
657
-
658
- // Change the file again, has errors.
659
- newFile (testFilePath, 'error' );
660
-
661
- // The timer cancelled on the watch event, and the file analyzed.
662
- await _waitAnalysisComplete ();
663
- _assertAnalyzedFiles (
664
- hasErrors: [testFile.path],
665
- noErrors: [],
666
- notAnalyzed: [],
667
- );
668
- }
669
-
670
607
Future <void > test_fileSystem_changeFile_packageConfigJsonFile () async {
671
608
var aaaRootPath = '/packages/aaa' ;
672
609
var a_path = '$aaaRootPath /lib/a.dart' ;
@@ -885,62 +822,6 @@ void f(A a) {}
885
822
assertNoErrorsNotification (a_path);
886
823
}
887
824
888
- /// This test ensures that when an `addOverlay` cancels any pending
889
- /// `removeOverlay` timer, it also removes it, so that a subsequent watch
890
- /// event does not still try to process it.
891
- Future <void >
892
- test_fileSystem_removeOverlay_addOverlay_changeFile_changeOverlay () async {
893
- // Use long delay, so that it does not happen.
894
- server.pendingFilesRemoveOverlayDelay = const Duration (seconds: 300 );
895
-
896
- newFile (testFilePath, '' );
897
-
898
- // Add an overlay without errors.
899
- await handleSuccessfulRequest (
900
- AnalysisUpdateContentParams ({
901
- testFile.path: AddContentOverlay ('' ),
902
- }).toRequest ('0' ),
903
- );
904
-
905
- await setRoots (included: [workspaceRootPath], excluded: []);
906
-
907
- // The test file (overlay) is analyzed, no errors.
908
- await _waitAnalysisComplete ();
909
- _assertAnalyzedFiles (
910
- hasErrors: [],
911
- noErrors: [testFile.path],
912
- notAnalyzed: [],
913
- );
914
-
915
- // Ask to remove the overlay, still active, start a timer.
916
- await handleSuccessfulRequest (
917
- AnalysisUpdateContentParams ({
918
- testFile.path: RemoveContentOverlay (),
919
- }).toRequest ('0' ),
920
- );
921
-
922
- // Re-add an overlay. Should cancel the timer and replace the overlay.
923
- await handleSuccessfulRequest (
924
- AnalysisUpdateContentParams ({
925
- testFile.path: AddContentOverlay ('' ),
926
- }).toRequest ('0' ),
927
- );
928
-
929
- // Change the file to trigger the watcher. Since the request above should
930
- // have cancelled (and removed) the timer, this should not do anything
931
- // (specifically, it should not remove the new overlay).
932
- modifyFile (testFilePath, 'error' );
933
-
934
- // The overlay should still be present, so we should be able to change it.
935
- await handleSuccessfulRequest (
936
- AnalysisUpdateContentParams ({
937
- testFile.path: ChangeContentOverlay (
938
- [SourceEdit (0 , 0 , '//' )],
939
- ),
940
- }).toRequest ('0' ),
941
- );
942
- }
943
-
944
825
Future <void > test_setPriorityFiles () async {
945
826
var a = getFile ('$workspaceRootPath /foo/lib/a.dart' );
946
827
var b = getFile ('$workspaceRootPath /foo/lib/b.dart' );
0 commit comments