| OLD | NEW |
| 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 Loading... |
| 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(anyString)).thenReturn(true); |
| 182 |
| 180 AnalysisServer server = new AnalysisServerMock(); | 183 AnalysisServer server = new AnalysisServerMock(); |
| 181 when(server.getAnalysisContexts()).thenReturn([context]); | 184 when(server.getAnalysisContexts()).thenReturn([context]); |
| 185 when(server.contextDirectoryManager).thenReturn(manager); |
| 182 when(server.isAnalysisComplete()).thenReturn(false); | 186 when(server.isAnalysisComplete()).thenReturn(false); |
| 183 | 187 |
| 184 StreamController controller = new StreamController.broadcast(sync: true); | 188 StreamController controller = new StreamController.broadcast(sync: true); |
| 185 when(server.onFileAnalyzed).thenReturn(controller.stream); | 189 when(server.onFileAnalyzed).thenReturn(controller.stream); |
| 186 | 190 |
| 187 List<String> unsentNotifications = <String>[ | 191 List<String> unsentNotifications = <String>[ |
| 188 source1.fullName, source2.fullName, source3.fullName, | 192 source1.fullName, source2.fullName, source3.fullName, |
| 189 source4.fullName, source5.fullName]; | 193 source4.fullName, source5.fullName]; |
| 190 when(server.sendNotification(anyObject)) | 194 when(server.sendNotification(anyObject)) |
| 191 .thenInvoke((Notification notification) { | 195 .thenInvoke((Notification notification) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 264 |
| 261 @override | 265 @override |
| 262 bool matches(item, Map matchState) { | 266 bool matches(item, Map matchState) { |
| 263 if (item is! ExecutableFile) { | 267 if (item is! ExecutableFile) { |
| 264 return false; | 268 return false; |
| 265 } | 269 } |
| 266 ExecutableFile file = item; | 270 ExecutableFile file = item; |
| 267 return item.file == expectedFile && item.kind == expectedKind; | 271 return item.file == expectedFile && item.kind == expectedKind; |
| 268 } | 272 } |
| 269 } | 273 } |
| OLD | NEW |