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

Unified Diff: pkg/analysis_server/test/domain_analysis_test.dart

Issue 398513002: Fix for NPE if subscribing for errors in a not analyzed file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/domain_analysis_test.dart
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index f9ee43c93f31b64520b751b0bda2f16fae9ab959..b4b0442e015fee7e3f985198c2766d61c3380bf6 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -325,6 +325,19 @@ void test_setSubscriptions() {
});
});
});
+
+ test('after analysis, no such file', () {
+ AnalysisTestHelper helper = new AnalysisTestHelper();
+ helper.createSingleFileProject('int V = 42;');
+ return helper.waitForOperationsFinished().then((_) {
+ String noFile = '/no-such.file.dart';
+ helper.addAnalysisSubscriptionErrors(noFile);
+ return helper.waitForOperationsFinished().then((_) {
+ var errors = helper.getErrors(noFile);
+ expect(errors, isEmpty);
+ });
+ });
+ });
}
@@ -484,6 +497,10 @@ class AnalysisTestHelper {
handleSuccessfulRequest(request);
}
+ void addAnalysisSubscriptionErrors(String file) {
+ addAnalysisSubscription(AnalysisService.ERRORS, file);
+ }
+
void addAnalysisSubscriptionHighlights(String file) {
addAnalysisSubscription(AnalysisService.HIGHLIGHTS, file);
}
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698