| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io' as io; | 6 import 'dart:io' as io; |
| 7 | 7 |
| 8 import 'package:analysis_server/src/plugin/notification_manager.dart'; | 8 import 'package:analysis_server/src/plugin/notification_manager.dart'; |
| 9 import 'package:analysis_server/src/plugin/plugin_manager.dart'; | 9 import 'package:analysis_server/src/plugin/plugin_manager.dart'; |
| 10 import 'package:analyzer/context/context_root.dart'; | 10 import 'package:analyzer/context/context_root.dart'; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 await withPlugin( | 133 await withPlugin( |
| 134 pluginName: 'plugin1', | 134 pluginName: 'plugin1', |
| 135 test: (String plugin1Path) async { | 135 test: (String plugin1Path) async { |
| 136 await withPlugin( | 136 await withPlugin( |
| 137 pluginName: 'plugin2', | 137 pluginName: 'plugin2', |
| 138 test: (String plugin2Path) async { | 138 test: (String plugin2Path) async { |
| 139 ContextRoot contextRoot = new ContextRoot(pkgPath, []); | 139 ContextRoot contextRoot = new ContextRoot(pkgPath, []); |
| 140 await manager.addPluginToContextRoot(contextRoot, plugin1Path); | 140 await manager.addPluginToContextRoot(contextRoot, plugin1Path); |
| 141 await manager.addPluginToContextRoot(contextRoot, plugin2Path); | 141 await manager.addPluginToContextRoot(contextRoot, plugin2Path); |
| 142 | 142 |
| 143 List<Future<Response>> responses = manager.broadcast( | 143 Map<PluginInfo, Future<Response>> responses = manager.broadcast( |
| 144 contextRoot, | 144 contextRoot, |
| 145 new CompletionGetSuggestionsParams( | 145 new CompletionGetSuggestionsParams( |
| 146 '/pkg1/lib/pkg1.dart', 100)); | 146 '/pkg1/lib/pkg1.dart', 100)); |
| 147 expect(responses, hasLength(2)); | 147 expect(responses, hasLength(2)); |
| 148 | 148 |
| 149 await manager.stopAll(); | 149 await manager.stopAll(); |
| 150 }); | 150 }); |
| 151 }); | 151 }); |
| 152 pkg1Dir.deleteSync(recursive: true); | 152 pkg1Dir.deleteSync(recursive: true); |
| 153 } | 153 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 void setUp() { | 219 void setUp() { |
| 220 resourceProvider = new MemoryResourceProvider(); | 220 resourceProvider = new MemoryResourceProvider(); |
| 221 byteStorePath = '/byteStore'; | 221 byteStorePath = '/byteStore'; |
| 222 notificationManager = new TestNotificationManager(); | 222 notificationManager = new TestNotificationManager(); |
| 223 manager = new PluginManager(resourceProvider, byteStorePath, | 223 manager = new PluginManager(resourceProvider, byteStorePath, |
| 224 notificationManager, InstrumentationService.NULL_SERVICE); | 224 notificationManager, InstrumentationService.NULL_SERVICE); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void test_broadcast_none() { | 227 void test_broadcast_none() { |
| 228 ContextRoot contextRoot = new ContextRoot('/pkg1', []); | 228 ContextRoot contextRoot = new ContextRoot('/pkg1', []); |
| 229 List<Future<Response>> responses = manager.broadcast(contextRoot, | 229 Map<PluginInfo, Future<Response>> responses = manager.broadcast(contextRoot, |
| 230 new CompletionGetSuggestionsParams('/pkg1/lib/pkg1.dart', 100)); | 230 new CompletionGetSuggestionsParams('/pkg1/lib/pkg1.dart', 100)); |
| 231 expect(responses, hasLength(0)); | 231 expect(responses, hasLength(0)); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void test_creation() { | 234 void test_creation() { |
| 235 expect(manager.resourceProvider, resourceProvider); | 235 expect(manager.resourceProvider, resourceProvider); |
| 236 expect(manager.byteStorePath, byteStorePath); | 236 expect(manager.byteStorePath, byteStorePath); |
| 237 expect(manager.notificationManager, notificationManager); | 237 expect(manager.notificationManager, notificationManager); |
| 238 } | 238 } |
| 239 | 239 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 void onNotification(Notification notification), | 547 void onNotification(Notification notification), |
| 548 {Function onError, void onDone()}) { | 548 {Function onError, void onDone()}) { |
| 549 fail('Unexpected invocation of listen'); | 549 fail('Unexpected invocation of listen'); |
| 550 } | 550 } |
| 551 | 551 |
| 552 @override | 552 @override |
| 553 void sendRequest(Request request) { | 553 void sendRequest(Request request) { |
| 554 sentRequests.add(request); | 554 sentRequests.add(request); |
| 555 } | 555 } |
| 556 } | 556 } |
| OLD | NEW |