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/analysis_server.dart'; | 8 import 'package:analysis_server/src/analysis_server.dart'; |
9 import 'package:analysis_server/src/domain_diagnostic.dart'; | 9 import 'package:analysis_server/src/domain_diagnostic.dart'; |
10 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 10 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 manager.processPlugins(plugins); | 44 manager.processPlugins(plugins); |
45 // | 45 // |
46 // Create the server | 46 // Create the server |
47 // | 47 // |
48 var serverChannel = new MockServerChannel(); | 48 var serverChannel = new MockServerChannel(); |
49 resourceProvider = new MemoryResourceProvider(); | 49 resourceProvider = new MemoryResourceProvider(); |
50 MockSdk sdk = new MockSdk(resourceProvider: resourceProvider); | 50 MockSdk sdk = new MockSdk(resourceProvider: resourceProvider); |
51 server = new AnalysisServer( | 51 server = new AnalysisServer( |
52 serverChannel, | 52 serverChannel, |
53 resourceProvider, | 53 resourceProvider, |
54 new MockPackageMapProvider(), | |
55 null, | 54 null, |
56 serverPlugin, | 55 serverPlugin, |
57 new AnalysisServerOptions(), | 56 new AnalysisServerOptions(), |
58 new DartSdkManager('/', false, (_) => sdk), | 57 new DartSdkManager('/', false, (_) => sdk), |
59 InstrumentationService.NULL_SERVICE); | 58 InstrumentationService.NULL_SERVICE); |
60 handler = new DiagnosticDomainHandler(server); | 59 handler = new DiagnosticDomainHandler(server); |
61 }); | 60 }); |
62 | 61 |
63 group('DiagnosticDomainHandler', () { | 62 group('DiagnosticDomainHandler', () { |
64 test('getDiagnostics', () async { | 63 test('getDiagnostics', () async { |
(...skipping 21 matching lines...) Expand all Loading... |
86 }); | 85 }); |
87 | 86 |
88 test('getDiagnostics - (no root)', () async { | 87 test('getDiagnostics - (no root)', () async { |
89 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); | 88 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); |
90 var response = handler.handleRequest(request); | 89 var response = handler.handleRequest(request); |
91 Map json = response.toJson()[Response.RESULT]; | 90 Map json = response.toJson()[Response.RESULT]; |
92 expect(json['contexts'], hasLength(0)); | 91 expect(json['contexts'], hasLength(0)); |
93 }); | 92 }); |
94 }); | 93 }); |
95 } | 94 } |
OLD | NEW |