| 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 // } | 225 // } |
| 226 | 226 |
| 227 void setUp() { | 227 void setUp() { |
| 228 serverChannel = new MockServerChannel(); | 228 serverChannel = new MockServerChannel(); |
| 229 resourceProvider = new MemoryResourceProvider(); | 229 resourceProvider = new MemoryResourceProvider(); |
| 230 packageMapProvider = new MockPackageMapProvider(); | 230 packageMapProvider = new MockPackageMapProvider(); |
| 231 Index index = createIndex(); | 231 Index index = createIndex(); |
| 232 server = new AnalysisServer( | 232 server = new AnalysisServer( |
| 233 serverChannel, resourceProvider, packageMapProvider, index, | 233 serverChannel, resourceProvider, packageMapProvider, index, |
| 234 new MockSdk()); | 234 new MockSdk()); |
| 235 server.contextDirectoryManager.defaultOptions.enableAsync = true; |
| 236 server.contextDirectoryManager.defaultOptions.enableEnum = true; |
| 235 handler = new AnalysisDomainHandler(server); | 237 handler = new AnalysisDomainHandler(server); |
| 236 // listen for notifications | 238 // listen for notifications |
| 237 Stream<Notification> notificationStream = serverChannel.notificationControll
er.stream; | 239 Stream<Notification> notificationStream = serverChannel.notificationControll
er.stream; |
| 238 notificationStream.listen((Notification notification) { | 240 notificationStream.listen((Notification notification) { |
| 239 processNotification(notification); | 241 processNotification(notification); |
| 240 }); | 242 }); |
| 241 } | 243 } |
| 242 | 244 |
| 243 void tearDown() { | 245 void tearDown() { |
| 244 server.done(); | 246 server.done(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 256 return waitForServerOperationsPerformed(server); | 258 return waitForServerOperationsPerformed(server); |
| 257 } | 259 } |
| 258 | 260 |
| 259 static String _getCodeString(code) { | 261 static String _getCodeString(code) { |
| 260 if (code is List<String>) { | 262 if (code is List<String>) { |
| 261 code = code.join('\n'); | 263 code = code.join('\n'); |
| 262 } | 264 } |
| 263 return code as String; | 265 return code as String; |
| 264 } | 266 } |
| 265 } | 267 } |
| OLD | NEW |