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

Side by Side Diff: pkg/analysis_server/test/domain_execution_test.dart

Issue 630863003: Stop sending launchData for non-analyzed files (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.domain.execution; 5 library test.domain.execution;
6 6
7 import 'package:analyzer/file_system/physical_file_system.dart'; 7 import 'package:analyzer/file_system/physical_file_system.dart';
8 import 'package:analysis_server/src/analysis_server.dart'; 8 import 'package:analysis_server/src/analysis_server.dart';
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/domain_execution.dart'; 10 import 'package:analysis_server/src/domain_execution.dart';
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 AnalysisContext context = new AnalysisContextMock(); 170 AnalysisContext context = new AnalysisContextMock();
171 when(context.launchableClientLibrarySources) 171 when(context.launchableClientLibrarySources)
172 .thenReturn([source1, source2]); 172 .thenReturn([source1, source2]);
173 when(context.launchableServerLibrarySources) 173 when(context.launchableServerLibrarySources)
174 .thenReturn([source2, source3]); 174 .thenReturn([source2, source3]);
175 when(context.librarySources).thenReturn([source4]); 175 when(context.librarySources).thenReturn([source4]);
176 when(context.htmlSources).thenReturn([source5]); 176 when(context.htmlSources).thenReturn([source5]);
177 when(context.getLibrariesReferencedFromHtml(anyObject)) 177 when(context.getLibrariesReferencedFromHtml(anyObject))
178 .thenReturn([source6, source7]); 178 .thenReturn([source6, source7]);
179 179
180 ServerContextManager manager = new ServerContextManagerMock();
181 when(manager.isInAnalysisRoot(anyObject)).thenInvoke((String path) {
scheglov 2014/10/06 16:51:44 You could use anyString instead, if the argument i
Brian Wilkerson 2014/10/06 18:56:20 Done
182 return true;
183 });
184
180 AnalysisServer server = new AnalysisServerMock(); 185 AnalysisServer server = new AnalysisServerMock();
181 when(server.getAnalysisContexts()).thenReturn([context]); 186 when(server.getAnalysisContexts()).thenReturn([context]);
187 when(server.contextDirectoryManager).thenReturn(manager);
182 when(server.isAnalysisComplete()).thenReturn(false); 188 when(server.isAnalysisComplete()).thenReturn(false);
183 189
184 StreamController controller = new StreamController.broadcast(sync: true); 190 StreamController controller = new StreamController.broadcast(sync: true);
185 when(server.onFileAnalyzed).thenReturn(controller.stream); 191 when(server.onFileAnalyzed).thenReturn(controller.stream);
186 192
187 List<String> unsentNotifications = <String>[ 193 List<String> unsentNotifications = <String>[
188 source1.fullName, source2.fullName, source3.fullName, 194 source1.fullName, source2.fullName, source3.fullName,
189 source4.fullName, source5.fullName]; 195 source4.fullName, source5.fullName];
190 when(server.sendNotification(anyObject)) 196 when(server.sendNotification(anyObject))
191 .thenInvoke((Notification notification) { 197 .thenInvoke((Notification notification) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 266
261 @override 267 @override
262 bool matches(item, Map matchState) { 268 bool matches(item, Map matchState) {
263 if (item is! ExecutableFile) { 269 if (item is! ExecutableFile) {
264 return false; 270 return false;
265 } 271 }
266 ExecutableFile file = item; 272 ExecutableFile file = item;
267 return item.file == expectedFile && item.kind == expectedKind; 273 return item.file == expectedFile && item.kind == expectedKind;
268 } 274 }
269 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698