| 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 hide AnalysisOptions; | 10 hide AnalysisOptions; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 * Validates that the given [request] is handled successfully. | 190 * Validates that the given [request] is handled successfully. |
| 191 */ | 191 */ |
| 192 Response handleSuccessfulRequest(Request request, {RequestHandler handler}) { | 192 Response handleSuccessfulRequest(Request request, {RequestHandler handler}) { |
| 193 handler ??= this.handler; | 193 handler ??= this.handler; |
| 194 Response response = handler.handleRequest(request); | 194 Response response = handler.handleRequest(request); |
| 195 expect(response, isResponseSuccess(request.id)); | 195 expect(response, isResponseSuccess(request.id)); |
| 196 return response; | 196 return response; |
| 197 } | 197 } |
| 198 | 198 |
| 199 String modifyTestFile(String content) { | 199 String modifyTestFile(String content) { |
| 200 addFile(testFile, content); | 200 String path = resourceProvider.convertPath(testFile); |
| 201 resourceProvider.updateFile(path, content); |
| 201 this.testCode = content; | 202 this.testCode = content; |
| 202 return testFile; | 203 return testFile; |
| 203 } | 204 } |
| 204 | 205 |
| 205 void processNotification(Notification notification) { | 206 void processNotification(Notification notification) { |
| 206 if (notification.event == SERVER_ERROR) { | 207 if (notification.event == SERVER_ERROR) { |
| 207 var params = new ServerErrorParams.fromNotification(notification); | 208 var params = new ServerErrorParams.fromNotification(notification); |
| 208 serverErrors.add(params); | 209 serverErrors.add(params); |
| 209 } | 210 } |
| 210 } | 211 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } | 251 } |
| 251 | 252 |
| 252 /** | 253 /** |
| 253 * Completes with a successful [Response] for the given [request]. | 254 * Completes with a successful [Response] for the given [request]. |
| 254 * Otherwise fails. | 255 * Otherwise fails. |
| 255 */ | 256 */ |
| 256 Future<Response> waitResponse(Request request) async { | 257 Future<Response> waitResponse(Request request) async { |
| 257 return serverChannel.sendRequest(request); | 258 return serverChannel.sendRequest(request); |
| 258 } | 259 } |
| 259 } | 260 } |
| OLD | NEW |