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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.analysis.updateContent; 5 library test.analysis.updateContent;
6 6
7 import 'package:analysis_server/src/constants.dart'; 7 import 'package:analysis_server/src/constants.dart';
8 import 'package:analysis_server/src/protocol.dart'; 8 import 'package:analysis_server/src/protocol.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 ''') 80 ''')
81 }); 81 });
82 return waitForTasksFinished(); 82 return waitForTasksFinished();
83 }).then((_) { 83 }).then((_) {
84 // The overlay should have been propagated to both contexts, causing both 84 // The overlay should have been propagated to both contexts, causing both
85 // foo.dart and bar.dart to be reanalyzed and found to be free of errors. 85 // foo.dart and bar.dart to be reanalyzed and found to be free of errors.
86 expect(filesErrors[fooPath], isEmpty); 86 expect(filesErrors[fooPath], isEmpty);
87 expect(filesErrors[barPath], isEmpty); 87 expect(filesErrors[barPath], isEmpty);
88 }); 88 });
89 } 89 }
90
91 test_sendNoticesAfterNopChange() async {
92 createProject();
93 addTestFile('');
94 await server.onAnalysisComplete;
95 // add an overlay
96 server.updateContent('1', {
97 testFile: new AddContentOverlay('main() {} main() {}')
98 });
99 await server.onAnalysisComplete;
100 // clear errors and make a no-op change
101 filesErrors.clear();
102 server.updateContent('2', {
103 testFile: new ChangeContentOverlay([new SourceEdit(0, 4, 'main')])
104 });
105 await server.onAnalysisComplete;
106 // errors should have been resent
107 expect(filesErrors, isNotEmpty);
108 }
109
110 test_sendNoticesAfterNopChange_flushedUnit() async {
111 createProject();
112 addTestFile('');
113 await server.onAnalysisComplete;
114 // add an overlay
115 server.updateContent('1', {
116 testFile: new AddContentOverlay('main() {} main() {}')
117 });
118 await server.onAnalysisComplete;
119 // clear errors and make a no-op change
120 filesErrors.clear();
121 server.test_flushResolvedUnit(testFile);
122 server.updateContent('2', {
123 testFile: new ChangeContentOverlay([new SourceEdit(0, 4, 'main')])
124 });
125 await server.onAnalysisComplete;
126 // errors should have been resent
127 expect(filesErrors, isNotEmpty);
128 }
90 } 129 }
OLDNEW
« 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