| 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/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 | 185 |
| 186 void removeGeneralAnalysisSubscription(GeneralAnalysisService service) { | 186 void removeGeneralAnalysisSubscription(GeneralAnalysisService service) { |
| 187 generalServices.remove(service); | 187 generalServices.remove(service); |
| 188 Request request = new AnalysisSetGeneralSubscriptionsParams(generalServices) | 188 Request request = new AnalysisSetGeneralSubscriptionsParams(generalServices) |
| 189 .toRequest('0'); | 189 .toRequest('0'); |
| 190 handleSuccessfulRequest(request); | 190 handleSuccessfulRequest(request); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void setUp() { | 193 void setUp() { |
| 194 ExtensionManager manager = new ExtensionManager(); | |
| 195 ServerPlugin serverPlugin = new ServerPlugin(); | |
| 196 List<Plugin> plugins = [serverPlugin]; | |
| 197 plugins.addAll(AnalysisEngine.instance.supportedPlugins); | |
| 198 manager.processPlugins(plugins); | |
| 199 serverChannel = new MockServerChannel(); | 194 serverChannel = new MockServerChannel(); |
| 200 resourceProvider = new MemoryResourceProvider(); | 195 resourceProvider = new MemoryResourceProvider(); |
| 201 packageMapProvider = new MockPackageMapProvider(); | 196 packageMapProvider = new MockPackageMapProvider(); |
| 202 Index index = createIndex(); | 197 Index index = createIndex(); |
| 203 server = createAnalysisServer(index); | 198 server = createAnalysisServer(index); |
| 204 handler = server.handlers | 199 handler = server.handlers |
| 205 .singleWhere((handler) => handler is AnalysisDomainHandler); | 200 .singleWhere((handler) => handler is AnalysisDomainHandler); |
| 206 // listen for notifications | 201 // listen for notifications |
| 207 Stream<Notification> notificationStream = | 202 Stream<Notification> notificationStream = |
| 208 serverChannel.notificationController.stream; | 203 serverChannel.notificationController.stream; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 227 } | 222 } |
| 228 | 223 |
| 229 /** | 224 /** |
| 230 * Completes with a successful [Response] for the given [request]. | 225 * Completes with a successful [Response] for the given [request]. |
| 231 * Otherwise fails. | 226 * Otherwise fails. |
| 232 */ | 227 */ |
| 233 Future<Response> waitResponse(Request request) async { | 228 Future<Response> waitResponse(Request request) async { |
| 234 return serverChannel.sendRequest(request); | 229 return serverChannel.sendRequest(request); |
| 235 } | 230 } |
| 236 } | 231 } |
| OLD | NEW |