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/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/domain_analysis.dart'; | 10 import 'package:analysis_server/src/domain_analysis.dart'; |
11 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 | 13 |
14 import '../analysis_abstract.dart'; | 14 import '../analysis_abstract.dart'; |
15 import '../utils.dart'; | |
16 | 15 |
17 main() { | 16 main() { |
18 initializeTestEnvironment(); | |
19 defineReflectiveSuite(() { | 17 defineReflectiveSuite(() { |
20 defineReflectiveTests(GetErrorsTest); | 18 defineReflectiveTests(GetErrorsTest); |
21 }); | 19 }); |
22 } | 20 } |
23 | 21 |
24 @reflectiveTest | 22 @reflectiveTest |
25 class GetErrorsTest extends AbstractAnalysisTest { | 23 class GetErrorsTest extends AbstractAnalysisTest { |
26 static const String requestId = 'test-getError'; | 24 static const String requestId = 'test-getError'; |
27 | 25 |
28 @override | 26 @override |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 Request _createGetErrorsRequest(String file) { | 141 Request _createGetErrorsRequest(String file) { |
144 return new AnalysisGetErrorsParams(file).toRequest(requestId); | 142 return new AnalysisGetErrorsParams(file).toRequest(requestId); |
145 } | 143 } |
146 | 144 |
147 Future<List<AnalysisError>> _getErrors(String file) async { | 145 Future<List<AnalysisError>> _getErrors(String file) async { |
148 Request request = _createGetErrorsRequest(file); | 146 Request request = _createGetErrorsRequest(file); |
149 Response response = await serverChannel.sendRequest(request); | 147 Response response = await serverChannel.sendRequest(request); |
150 return new AnalysisGetErrorsResult.fromResponse(response).errors; | 148 return new AnalysisGetErrorsResult.fromResponse(response).errors; |
151 } | 149 } |
152 } | 150 } |
OLD | NEW |