OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'package:analysis_server/protocol/protocol_generated.dart'; | 5 import 'package:analysis_server/protocol/protocol_generated.dart'; |
6 import 'package:analysis_server/src/domain_diagnostic.dart'; | 6 import 'package:analysis_server/src/domain_diagnostic.dart'; |
7 import 'package:test/test.dart'; | 7 import 'package:test/test.dart'; |
8 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
9 | 9 |
10 import 'analysis_abstract.dart'; | 10 import 'analysis_abstract.dart'; |
11 | 11 |
12 main() { | 12 main() { |
13 defineReflectiveSuite(() { | 13 defineReflectiveSuite(() { |
14 defineReflectiveTests(DiagnosticDomainTest); | 14 defineReflectiveTests(DiagnosticDomainTest); |
15 }); | 15 }); |
16 } | 16 } |
17 | 17 |
18 @reflectiveTest | 18 @reflectiveTest |
19 class DiagnosticDomainTest extends AbstractAnalysisTest { | 19 class DiagnosticDomainTest extends AbstractAnalysisTest { |
20 @override | 20 @override |
21 void setUp() { | 21 void setUp() { |
22 enableNewAnalysisDriver = true; | |
23 generateSummaryFiles = true; | 22 generateSummaryFiles = true; |
24 super.setUp(); | 23 super.setUp(); |
25 handler = new DiagnosticDomainHandler(server); | 24 handler = new DiagnosticDomainHandler(server); |
26 server.handlers = [handler]; | 25 server.handlers = [handler]; |
27 } | 26 } |
28 | 27 |
29 test_getDiagnostics() async { | 28 test_getDiagnostics() async { |
30 String file = '/project/bin/test.dart'; | 29 String file = '/project/bin/test.dart'; |
31 resourceProvider.newFile('/project/pubspec.yaml', 'name: project'); | 30 resourceProvider.newFile('/project/pubspec.yaml', 'name: project'); |
32 resourceProvider.newFile(file, 'main() {}'); | 31 resourceProvider.newFile(file, 'main() {}'); |
(...skipping 17 matching lines...) Expand all Loading... |
50 expect(context.workItemQueueLength, isNotNull); | 49 expect(context.workItemQueueLength, isNotNull); |
51 } | 50 } |
52 | 51 |
53 test_getDiagnostics_noRoot() async { | 52 test_getDiagnostics_noRoot() async { |
54 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); | 53 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); |
55 var response = handler.handleRequest(request); | 54 var response = handler.handleRequest(request); |
56 var result = new DiagnosticGetDiagnosticsResult.fromResponse(response); | 55 var result = new DiagnosticGetDiagnosticsResult.fromResponse(response); |
57 expect(result.contexts, isEmpty); | 56 expect(result.contexts, isEmpty); |
58 } | 57 } |
59 } | 58 } |
OLD | NEW |