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

Unified Diff: pkg/analysis_server/test/analysis/update_content_test.dart

Issue 899753004: Send notificatinos after no-op changes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Schedule source analysis only if a change was made Created 5 years, 10 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
Index: pkg/analysis_server/test/analysis/update_content_test.dart
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
index 1fbcaa3feada0f07d190534781f38e36b50aff7c..f4d5bca234e2d638635c5ed6f76691d98e73ca83 100644
--- a/pkg/analysis_server/test/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart
@@ -87,4 +87,43 @@ f() {}
expect(filesErrors[barPath], isEmpty);
});
}
+
+ test_sendNoticesAfterNopChange() async {
+ createProject();
+ addTestFile('');
+ await server.onAnalysisComplete;
+ // add an overlay
+ server.updateContent('1', {
+ testFile: new AddContentOverlay('main() {} main() {}')
+ });
+ await server.onAnalysisComplete;
+ // clear errors and make a no-op change
+ filesErrors.clear();
+ server.updateContent('2', {
+ testFile: new ChangeContentOverlay([new SourceEdit(0, 4, 'main')])
+ });
+ await server.onAnalysisComplete;
+ // errors should have been resent
+ expect(filesErrors, isNotEmpty);
+ }
+
+ test_sendNoticesAfterNopChange_flushedUnit() async {
+ createProject();
+ addTestFile('');
+ await server.onAnalysisComplete;
+ // add an overlay
+ server.updateContent('1', {
+ testFile: new AddContentOverlay('main() {} main() {}')
+ });
+ await server.onAnalysisComplete;
+ // clear errors and make a no-op change
+ filesErrors.clear();
+ server.test_flushResolvedUnit(testFile);
+ server.updateContent('2', {
+ testFile: new ChangeContentOverlay([new SourceEdit(0, 4, 'main')])
+ });
+ await server.onAnalysisComplete;
+ // errors should have been resent
+ expect(filesErrors, isNotEmpty);
+ }
}
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698