| Index: dart/pkg/analysis_server/test/services/completion/completion_test_util.dart
|
| ===================================================================
|
| --- dart/pkg/analysis_server/test/services/completion/completion_test_util.dart (revision 43805)
|
| +++ dart/pkg/analysis_server/test/services/completion/completion_test_util.dart (working copy)
|
| @@ -9,6 +9,7 @@
|
| import 'package:analysis_server/src/protocol.dart' as protocol show Element,
|
| ElementKind;
|
| import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
|
| +import 'package:analysis_server/src/services/completion/common_usage_computer.dart';
|
| import 'package:analysis_server/src/services/completion/completion_manager.dart';
|
| import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
|
| import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
|
| @@ -450,7 +451,8 @@
|
| searchEngine,
|
| testSource,
|
| cache,
|
| - [computer]);
|
| + [computer],
|
| + new CommonUsageComputer({}));
|
| var result = _completionManager.computeFast(request);
|
| expect(request.replacementOffset, isNotNull);
|
| expect(request.replacementLength, isNotNull);
|
| @@ -2496,6 +2498,19 @@
|
| });
|
| }
|
|
|
| + test_new_instance() {
|
| + addTestSource('import "dart:math"; class A {x() {new Random().^}}');
|
| + computeFast();
|
| + return computeFull((bool result) {
|
| + assertSuggestInvocationMethod('nextBool', 'Random', 'bool');
|
| + assertSuggestInvocationMethod('nextDouble', 'Random', 'double');
|
| + assertSuggestInvocationMethod('nextInt', 'Random', 'int');
|
| + assertNotSuggested('Random');
|
| + assertNotSuggested('Object');
|
| + assertNotSuggested('A');
|
| + });
|
| + }
|
| +
|
| test_partFile_TypeName() {
|
| // SimpleIdentifier TypeName ConstructorName
|
| addSource('/testB.dart', '''
|
|
|