| 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/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 return testFile; | 149 return testFile; |
| 150 } | 150 } |
| 151 | 151 |
| 152 void processNotification(Notification notification) { | 152 void processNotification(Notification notification) { |
| 153 if (notification.event == SERVER_ERROR) { | 153 if (notification.event == SERVER_ERROR) { |
| 154 var params = new ServerErrorParams.fromNotification(notification); | 154 var params = new ServerErrorParams.fromNotification(notification); |
| 155 serverErrors.add(params); | 155 serverErrors.add(params); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 void removeGeneralAnalysisSubscription(GeneralAnalysisService service) { |
| 160 generalServices.remove(service); |
| 161 Request request = new AnalysisSetGeneralSubscriptionsParams(generalServices) |
| 162 .toRequest('0'); |
| 163 handleSuccessfulRequest(request); |
| 164 } |
| 165 |
| 159 void setUp() { | 166 void setUp() { |
| 160 serverChannel = new MockServerChannel(); | 167 serverChannel = new MockServerChannel(); |
| 161 resourceProvider = new MemoryResourceProvider(); | 168 resourceProvider = new MemoryResourceProvider(); |
| 162 packageMapProvider = new MockPackageMapProvider(); | 169 packageMapProvider = new MockPackageMapProvider(); |
| 163 Index index = createIndex(); | 170 Index index = createIndex(); |
| 164 server = createAnalysisServer(index); | 171 server = createAnalysisServer(index); |
| 165 handler = new AnalysisDomainHandler(server); | 172 handler = new AnalysisDomainHandler(server); |
| 166 // listen for notifications | 173 // listen for notifications |
| 167 Stream<Notification> notificationStream = | 174 Stream<Notification> notificationStream = |
| 168 serverChannel.notificationController.stream; | 175 serverChannel.notificationController.stream; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 187 } | 194 } |
| 188 | 195 |
| 189 /** | 196 /** |
| 190 * Completes with a successful [Response] for the given [request]. | 197 * Completes with a successful [Response] for the given [request]. |
| 191 * Otherwise fails. | 198 * Otherwise fails. |
| 192 */ | 199 */ |
| 193 Future<Response> waitResponse(Request request) async { | 200 Future<Response> waitResponse(Request request) async { |
| 194 return serverChannel.sendRequest(request); | 201 return serverChannel.sendRequest(request); |
| 195 } | 202 } |
| 196 } | 203 } |
| OLD | NEW |