Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart

Issue 1517693004: extract LibraryPrefixContributor from imported reference contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/test_all.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
index 1afd44a41183bb85e642bed4432052ab9ac91070..fb91d764dc1c23b98c767ed8a9a533d76fa5856b 100644
--- a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
@@ -4,8 +4,6 @@
library test.services.completion.toplevel;
-import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
- show Element, ElementKind;
import 'package:analysis_server/plugin/protocol/protocol.dart'
hide Element, ElementKind;
import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
@@ -33,7 +31,6 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest {
DartCompletionCache cache = request.cache;
if (!isCached(cache.importedTypeSuggestions, completion) &&
!isCached(cache.importedVoidReturnSuggestions, completion) &&
- !isCached(cache.libraryPrefixSuggestions, completion) &&
!isCached(cache.otherImportedSuggestions, completion)) {
fail('expected $completion to be cached');
}
@@ -116,7 +113,6 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest {
DartCompletionCache cache = request.cache;
if (isCached(cache.importedTypeSuggestions, completion) ||
isCached(cache.importedVoidReturnSuggestions, completion) ||
- isCached(cache.libraryPrefixSuggestions, completion) ||
isCached(cache.otherImportedSuggestions, completion)) {
fail('expected $completion NOT to be cached');
}
@@ -203,21 +199,6 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest {
name, returnType, relevance, kind, importUri);
}
- @override
- CompletionSuggestion assertSuggestLibraryPrefix(String prefix,
- [int relevance = DART_RELEVANCE_DEFAULT,
- CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
- CompletionSuggestion cs =
- assertSuggest(prefix, csKind: kind, relevance: relevance);
- protocol.Element element = cs.element;
- expect(element, isNotNull);
- expect(element.kind, equals(protocol.ElementKind.LIBRARY));
- expect(element.parameters, isNull);
- expect(element.returnType, isNull);
- assertHasNoParameterInfo(cs);
- return cs;
- }
-
fail_enum_deprecated() {
addSource('/libA.dart', 'library A; @deprecated enum E { one, two }');
addTestSource('import "/libA.dart"; main() {^}');
@@ -552,7 +533,8 @@ main() {new ^ String x = "hello";}''');
expect(suggestion.requiredParameterCount, 0);
expect(suggestion.hasNamedParameters, true);
- assertSuggestLibraryPrefix('math');
+ // Suggested by LibraryPrefixContributor
+ assertNotSuggested('math');
});
}
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/test_all.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698