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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analysis_server/plugin/protocol/protocol.dart' | 7 import 'package:analysis_server/plugin/protocol/protocol.dart' |
8 hide AnalysisOptions; | 8 hide AnalysisOptions; |
9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } | 268 } |
269 | 269 |
270 /** | 270 /** |
271 * A plugin manager that simulates broadcasting requests to plugins by | 271 * A plugin manager that simulates broadcasting requests to plugins by |
272 * hard-coding the responses. | 272 * hard-coding the responses. |
273 */ | 273 */ |
274 class TestPluginManager implements PluginManager { | 274 class TestPluginManager implements PluginManager { |
275 plugin.AnalysisSetPriorityFilesParams analysisSetPriorityFilesParams; | 275 plugin.AnalysisSetPriorityFilesParams analysisSetPriorityFilesParams; |
276 plugin.AnalysisSetSubscriptionsParams analysisSetSubscriptionsParams; | 276 plugin.AnalysisSetSubscriptionsParams analysisSetSubscriptionsParams; |
277 plugin.AnalysisUpdateContentParams analysisUpdateContentParams; | 277 plugin.AnalysisUpdateContentParams analysisUpdateContentParams; |
| 278 plugin.RequestParams broadcastedRequest; |
278 Map<PluginInfo, Future<plugin.Response>> broadcastResults; | 279 Map<PluginInfo, Future<plugin.Response>> broadcastResults; |
279 | 280 |
280 @override | 281 @override |
281 String get byteStorePath { | 282 String get byteStorePath { |
282 fail('Unexpected invocation of byteStorePath'); | 283 fail('Unexpected invocation of byteStorePath'); |
283 return null; | 284 return null; |
284 } | 285 } |
285 | 286 |
286 @override | 287 @override |
287 InstrumentationService get instrumentationService { | 288 InstrumentationService get instrumentationService { |
(...skipping 15 matching lines...) Expand all Loading... |
303 | 304 |
304 @override | 305 @override |
305 Future<Null> addPluginToContextRoot( | 306 Future<Null> addPluginToContextRoot( |
306 analyzer.ContextRoot contextRoot, String path) async { | 307 analyzer.ContextRoot contextRoot, String path) async { |
307 fail('Unexpected invocation of addPluginToContextRoot'); | 308 fail('Unexpected invocation of addPluginToContextRoot'); |
308 return null; | 309 return null; |
309 } | 310 } |
310 | 311 |
311 @override | 312 @override |
312 Map<PluginInfo, Future<plugin.Response>> broadcastRequest( | 313 Map<PluginInfo, Future<plugin.Response>> broadcastRequest( |
313 analyzer.ContextRoot contextRoot, plugin.RequestParams params) { | 314 plugin.RequestParams params, |
| 315 {analyzer.ContextRoot contextRoot}) { |
| 316 broadcastedRequest = params; |
314 return broadcastResults ?? <PluginInfo, Future<plugin.Response>>{}; | 317 return broadcastResults ?? <PluginInfo, Future<plugin.Response>>{}; |
315 } | 318 } |
316 | 319 |
317 @override | 320 @override |
318 Future<List<Future<plugin.Response>>> broadcastWatchEvent( | 321 Future<List<Future<plugin.Response>>> broadcastWatchEvent( |
319 WatchEvent watchEvent) async { | 322 WatchEvent watchEvent) async { |
320 return <Future<plugin.Response>>[]; | 323 return <Future<plugin.Response>>[]; |
321 } | 324 } |
322 | 325 |
323 @override | 326 @override |
(...skipping 24 matching lines...) Expand all Loading... |
348 plugin.AnalysisUpdateContentParams params) { | 351 plugin.AnalysisUpdateContentParams params) { |
349 analysisUpdateContentParams = params; | 352 analysisUpdateContentParams = params; |
350 } | 353 } |
351 | 354 |
352 @override | 355 @override |
353 Future<List<Null>> stopAll() async { | 356 Future<List<Null>> stopAll() async { |
354 fail('Unexpected invocation of stopAll'); | 357 fail('Unexpected invocation of stopAll'); |
355 return null; | 358 return null; |
356 } | 359 } |
357 } | 360 } |
OLD | NEW |