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 library test.domain.diagnostic; | 5 library test.domain.diagnostic; |
6 | 6 |
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
8 import 'package:analysis_server/src/domain_diagnostic.dart'; | 8 import 'package:analysis_server/src/domain_diagnostic.dart'; |
9 import 'package:test/test.dart'; | 9 import 'package:test/test.dart'; |
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
(...skipping 28 matching lines...) Expand all Loading... |
39 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); | 39 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); |
40 var response = handler.handleRequest(request); | 40 var response = handler.handleRequest(request); |
41 var result = new DiagnosticGetDiagnosticsResult.fromResponse(response); | 41 var result = new DiagnosticGetDiagnosticsResult.fromResponse(response); |
42 | 42 |
43 expect(result.contexts, hasLength(1)); | 43 expect(result.contexts, hasLength(1)); |
44 | 44 |
45 ContextData context = result.contexts[0]; | 45 ContextData context = result.contexts[0]; |
46 expect(context.name, '/project'); | 46 expect(context.name, '/project'); |
47 expect(context.explicitFileCount, 1); /* test.dart */ | 47 expect(context.explicitFileCount, 1); /* test.dart */ |
48 | 48 |
49 if (enableNewAnalysisDriver) { | 49 expect(context.implicitFileCount, 4); |
50 expect(context.implicitFileCount, 0); | |
51 } else { | |
52 // dart:core dart:async dart:math dart:_internal | |
53 expect(context.implicitFileCount, 4); | |
54 } | |
55 | 50 |
56 expect(context.workItemQueueLength, isNotNull); | 51 expect(context.workItemQueueLength, isNotNull); |
57 } | 52 } |
58 | 53 |
59 test_getDiagnostics_noRoot() async { | 54 test_getDiagnostics_noRoot() async { |
60 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); | 55 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); |
61 var response = handler.handleRequest(request); | 56 var response = handler.handleRequest(request); |
62 var result = new DiagnosticGetDiagnosticsResult.fromResponse(response); | 57 var result = new DiagnosticGetDiagnosticsResult.fromResponse(response); |
63 expect(result.contexts, isEmpty); | 58 expect(result.contexts, isEmpty); |
64 } | 59 } |
65 } | 60 } |
66 | 61 |
67 @reflectiveTest | 62 @reflectiveTest |
68 class DiagnosticDomainTest_Driver extends DiagnosticDomainTest { | 63 class DiagnosticDomainTest_Driver extends DiagnosticDomainTest { |
69 @override | 64 @override |
70 void setUp() { | 65 void setUp() { |
71 enableNewAnalysisDriver = true; | 66 enableNewAnalysisDriver = true; |
72 generateSummaryFiles = true; | 67 generateSummaryFiles = true; |
73 super.setUp(); | 68 super.setUp(); |
74 } | 69 } |
75 } | 70 } |
OLD | NEW |