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_server; | 5 library test.analysis_server; |
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/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ExtensionManager manager = new ExtensionManager(); | 130 ExtensionManager manager = new ExtensionManager(); |
131 manager.processPlugins(plugins); | 131 manager.processPlugins(plugins); |
132 } | 132 } |
133 | 133 |
134 void setUp() { | 134 void setUp() { |
135 ExtensionManager manager = new ExtensionManager(); | 135 ExtensionManager manager = new ExtensionManager(); |
136 ServerPlugin plugin = new ServerPlugin(); | 136 ServerPlugin plugin = new ServerPlugin(); |
137 manager.processPlugins([plugin]); | 137 manager.processPlugins([plugin]); |
138 channel = new MockServerChannel(); | 138 channel = new MockServerChannel(); |
139 resourceProvider = new MemoryResourceProvider(); | 139 resourceProvider = new MemoryResourceProvider(); |
140 MockSdk sdk = new MockSdk(resourceProvider: resourceProvider); | 140 // Create an SDK in the mock file system. |
| 141 new MockSdk(resourceProvider: resourceProvider); |
141 packageMapProvider = new MockPackageMapProvider(); | 142 packageMapProvider = new MockPackageMapProvider(); |
142 server = new AnalysisServer( | 143 server = new AnalysisServer( |
143 channel, | 144 channel, |
144 resourceProvider, | 145 resourceProvider, |
145 packageMapProvider, | 146 packageMapProvider, |
146 null, | 147 null, |
147 plugin, | 148 plugin, |
148 new AnalysisServerOptions(), | 149 new AnalysisServerOptions(), |
149 new DartSdkManager('/', false, (_) => sdk), | 150 new DartSdkManager('/', false), |
150 InstrumentationService.NULL_SERVICE, | 151 InstrumentationService.NULL_SERVICE, |
151 rethrowExceptions: true); | 152 rethrowExceptions: true); |
152 processRequiredPlugins(); | 153 processRequiredPlugins(); |
153 } | 154 } |
154 | 155 |
155 Future test_contextDisposed() { | 156 Future test_contextDisposed() { |
156 resourceProvider.newFolder('/foo'); | 157 resourceProvider.newFolder('/foo'); |
157 resourceProvider.newFile('/foo/bar.dart', 'library lib;'); | 158 resourceProvider.newFile('/foo/bar.dart', 'library lib;'); |
158 server.setAnalysisRoots('0', ['/foo'], [], {}); | 159 server.setAnalysisRoots('0', ['/foo'], [], {}); |
159 AnalysisContext context; | 160 AnalysisContext context; |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 _MockServerOperation(this.context); | 570 _MockServerOperation(this.context); |
570 | 571 |
571 @override | 572 @override |
572 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; | 573 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; |
573 | 574 |
574 @override | 575 @override |
575 void perform(AnalysisServer server) { | 576 void perform(AnalysisServer server) { |
576 isComplete = true; | 577 isComplete = true; |
577 } | 578 } |
578 } | 579 } |
OLD | NEW |