| 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.analysis.abstract; | 5 library test.domain.analysis.abstract; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/domain_analysis.dart'; | 10 import 'package:analysis_server/src/domain_analysis.dart'; |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 void setUp() { | 225 void setUp() { |
| 226 serverChannel = new MockServerChannel(); | 226 serverChannel = new MockServerChannel(); |
| 227 resourceProvider = new MemoryResourceProvider(); | 227 resourceProvider = new MemoryResourceProvider(); |
| 228 packageMapProvider = new MockPackageMapProvider(); | 228 packageMapProvider = new MockPackageMapProvider(); |
| 229 Index index = createIndex(); | 229 Index index = createIndex(); |
| 230 server = new AnalysisServer( | 230 server = new AnalysisServer( |
| 231 serverChannel, | 231 serverChannel, |
| 232 resourceProvider, | 232 resourceProvider, |
| 233 packageMapProvider, | 233 packageMapProvider, |
| 234 index, | 234 index, |
| 235 new AnalysisServerOptions(), |
| 235 new MockSdk()); | 236 new MockSdk()); |
| 236 server.contextDirectoryManager.defaultOptions.enableAsync = true; | 237 server.contextDirectoryManager.defaultOptions.enableAsync = true; |
| 237 server.contextDirectoryManager.defaultOptions.enableEnum = true; | 238 server.contextDirectoryManager.defaultOptions.enableEnum = true; |
| 238 handler = new AnalysisDomainHandler(server); | 239 handler = new AnalysisDomainHandler(server); |
| 239 // listen for notifications | 240 // listen for notifications |
| 240 Stream<Notification> notificationStream = | 241 Stream<Notification> notificationStream = |
| 241 serverChannel.notificationController.stream; | 242 serverChannel.notificationController.stream; |
| 242 notificationStream.listen((Notification notification) { | 243 notificationStream.listen((Notification notification) { |
| 243 processNotification(notification); | 244 processNotification(notification); |
| 244 }); | 245 }); |
| 245 } | 246 } |
| 246 | 247 |
| 247 void tearDown() { | 248 void tearDown() { |
| 248 server.done(); | 249 server.done(); |
| 249 handler = null; | 250 handler = null; |
| 250 server = null; | 251 server = null; |
| 251 resourceProvider = null; | 252 resourceProvider = null; |
| 252 serverChannel = null; | 253 serverChannel = null; |
| 253 } | 254 } |
| 254 | 255 |
| 255 /** | 256 /** |
| 256 * Returns a [Future] that completes when the [AnalysisServer] finishes | 257 * Returns a [Future] that completes when the [AnalysisServer] finishes |
| 257 * all its scheduled tasks. | 258 * all its scheduled tasks. |
| 258 */ | 259 */ |
| 259 Future waitForTasksFinished() { | 260 Future waitForTasksFinished() { |
| 260 return waitForServerOperationsPerformed(server); | 261 return waitForServerOperationsPerformed(server); |
| 261 } | 262 } |
| 262 } | 263 } |
| OLD | NEW |