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

Unified Diff: pkg/analysis_server/test/domain_completion_test.dart

Issue 1347283005: refactor ContributionSorter to use new API (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 3 months 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
Index: pkg/analysis_server/test/domain_completion_test.dart
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 577363621551f3517254a65c74ce0b9fccfa285a..1202ef3317fe0eebd82ad934ea74bfe9ddfe9a83 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -8,6 +8,7 @@ import 'dart:async';
import 'package:analysis_server/completion/completion_core.dart'
show CompletionRequest, CompletionResult;
+import 'package:analysis_server/completion/completion_dart.dart' as newApi;
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/channel/channel.dart';
import 'package:analysis_server/src/constants.dart';
@@ -481,7 +482,7 @@ class CompletionTest extends AbstractAnalysisTest {
expect(suggestions.any((s) => s.relevance == DART_RELEVANCE_COMMON_USAGE),
isFalse);
DartCompletionManager.defaultContributionSorter = originalSorter;
- expect(mockSorter.count, 2);
+ mockSorter.enabled = false;
});
}
@@ -715,11 +716,12 @@ class MockContext implements AnalysisContext {
}
class MockRelevancySorter implements ContributionSorter {
- int count = 0;
+ bool enabled = true;
@override
- void sort(DartCompletionRequest request) {
- if (++count > 2) {
+ void sort(newApi.DartCompletionRequest request,
+ List<CompletionSuggestion> suggestions) {
+ if (!enabled) {
throw 'unexpected sort';
}
}

Powered by Google App Engine
This is Rietveld 408576698