| 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.analysis.get_errors; | 5 library test.analysis.get_errors; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
| 10 import 'package:analysis_server/src/domain_analysis.dart'; | 10 import 'package:analysis_server/src/domain_analysis.dart'; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // wait for an error response | 112 // wait for an error response |
| 113 return serverChannel.waitForResponse(request).then((Response response) { | 113 return serverChannel.waitForResponse(request).then((Response response) { |
| 114 expect(response.getResult(ERRORS), isEmpty); | 114 expect(response.getResult(ERRORS), isEmpty); |
| 115 RequestError error = response.error; | 115 RequestError error = response.error; |
| 116 expect(error, isNotNull); | 116 expect(error, isNotNull); |
| 117 expect(error.code, 'GET_ERRORS_ERROR'); | 117 expect(error.code, 'GET_ERRORS_ERROR'); |
| 118 }); | 118 }); |
| 119 } | 119 } |
| 120 | 120 |
| 121 Request _createGetErrorsRequest() { | 121 Request _createGetErrorsRequest() { |
| 122 Request request = new Request(requestId, ANALYSIS_GET_ERRORS); | 122 return new AnalysisGetErrorsParams(testFile).toRequest(requestId); |
| 123 request.setParameter(FILE, testFile); | |
| 124 return request; | |
| 125 } | 123 } |
| 126 | 124 |
| 127 Future<List<AnalysisError>> _getErrors(String file) { | 125 Future<List<AnalysisError>> _getErrors(String file) { |
| 128 Request request = _createGetErrorsRequest(); | 126 Request request = _createGetErrorsRequest(); |
| 129 return serverChannel.sendRequest(request).then((Response response) { | 127 return serverChannel.sendRequest(request).then((Response response) { |
| 130 return new AnalysisGetErrorsResult.fromResponse(response).errors; | 128 return new AnalysisGetErrorsResult.fromResponse(response).errors; |
| 131 }); | 129 }); |
| 132 } | 130 } |
| 133 } | 131 } |
| OLD | NEW |