Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: pkg/analyzer/test/src/dart/analysis/driver_test.dart

Issue 2550093011: Fix race condition with 'knownFiles'. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/driver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/dart/analysis/driver_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index 860d6de731646a45e94f8055967b9a929e01ddfd..5a8d884b3aec4bb078268e1e9837ee03014acfaa 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -936,6 +936,24 @@ import 'b.dart';
expect(driver.knownFiles, contains(b));
}
+ test_knownFiles_beforeAnalysis() async {
+ var a = _p('/test/lib/a.dart');
+ var b = _p('/test/lib/b.dart');
+
+ provider.newFile(a, '');
+
+ driver.addFile(a);
+ expect(driver.knownFiles, contains(a));
+ expect(driver.knownFiles, isNot(contains(b)));
+
+ // Remove 'a.dart'.
+ // It has been no analysis yet, so 'a.dart' is not in the file state, only
+ // in 'added' files. So, it disappears when removed.
+ driver.removeFile(a);
+ expect(driver.knownFiles, isNot(contains(a)));
+ expect(driver.knownFiles, isNot(contains(b)));
+ }
+
test_parseFile_shouldRefresh() async {
var p = _p('/test/bin/a.dart');
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/driver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698