| 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.services.completion.dart.util; | 5 library test.services.completion.dart.util; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol | 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol |
| 10 show Element, ElementKind; | 10 show Element, ElementKind; |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 expect(element.returnType, 'dynamic'); | 428 expect(element.returnType, 'dynamic'); |
| 429 } | 429 } |
| 430 assertHasNoParameterInfo(cs); | 430 assertHasNoParameterInfo(cs); |
| 431 return cs; | 431 return cs; |
| 432 } | 432 } |
| 433 | 433 |
| 434 /** | 434 /** |
| 435 * Return a [Future] that completes with the containing library information | 435 * Return a [Future] that completes with the containing library information |
| 436 * after it is accessible via [context.getLibrariesContaining]. | 436 * after it is accessible via [context.getLibrariesContaining]. |
| 437 */ | 437 */ |
| 438 Future computeLibrariesContaining([int times = 200]) { | 438 Future<Null> computeLibrariesContaining([int times = 200]) { |
| 439 if (enableNewAnalysisDriver) { |
| 440 return new Future.value(null); |
| 441 } |
| 439 List<Source> libraries = context.getLibrariesContaining(testSource); | 442 List<Source> libraries = context.getLibrariesContaining(testSource); |
| 440 if (libraries.isNotEmpty) { | 443 if (libraries.isNotEmpty) { |
| 441 return new Future.value(libraries); | 444 return new Future.value(null); |
| 442 } | 445 } |
| 443 if (times == 0) { | 446 if (times == 0) { |
| 444 fail('failed to determine libraries containing $testSource'); | 447 fail('failed to determine libraries containing $testSource'); |
| 445 } | 448 } |
| 446 context.performAnalysisTask(); | 449 context.performAnalysisTask(); |
| 447 // We use a delayed future to allow microtask events to finish. The | 450 // We use a delayed future to allow microtask events to finish. The |
| 448 // Future.value or Future() constructors use scheduleMicrotask themselves an
d | 451 // Future.value or Future() constructors use scheduleMicrotask themselves an
d |
| 449 // would therefore not wait for microtask callbacks that are scheduled after | 452 // would therefore not wait for microtask callbacks that are scheduled after |
| 450 // invoking this method. | 453 // invoking this method. |
| 451 return new Future.delayed( | 454 return new Future.delayed( |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 } | 576 } |
| 574 | 577 |
| 575 @override | 578 @override |
| 576 void setUp() { | 579 void setUp() { |
| 577 super.setUp(); | 580 super.setUp(); |
| 578 index = createMemoryIndex(); | 581 index = createMemoryIndex(); |
| 579 searchEngine = new SearchEngineImpl(index); | 582 searchEngine = new SearchEngineImpl(index); |
| 580 contributor = createContributor(); | 583 contributor = createContributor(); |
| 581 } | 584 } |
| 582 } | 585 } |
| OLD | NEW |