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

Unified Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 1844683002: Issue 26106. Don't attempt to incrementally resolve sources without contents. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months 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/context/context.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/context/context_test.dart
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index 63130a5cbcfd905f9872605145a5105d4ff7d183..b2e1f0493d69518eaa94363a97cbbbadfc6ecb5e 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -1397,6 +1397,22 @@ main() {}''');
expect(analysisResult.changeNotices, isNotNull);
}
+ void test_handleContentsChanged_incremental_newContentsNull() {
+ context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
+ ContentCache contentCache = new ContentCache();
+ context.contentCache = contentCache;
+ // old contents
+ String oldContents = 'foo() {}';
+ Source source = resourceProvider.getFile('/test.dart').createSource();
+ contentCache.setContents(source, oldContents);
+ expect(context.computeLibraryElement(source), isNotNull);
+ // new contents
+ String newContents = null;
+ contentCache.setContents(source, newContents);
+ context.handleContentsChanged(source, oldContents, newContents, true);
+ expect(context.getLibraryElement(source), isNull);
+ }
+
Future test_implicitAnalysisEvents_added() async {
AnalyzedSourcesListener listener = new AnalyzedSourcesListener();
context.implicitAnalysisEvents.listen(listener.onData);
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698