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

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

Issue 1389473002: only send final completion notification (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: update test to reflect new reality Created 5 years, 2 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
« no previous file with comments | « pkg/analysis_server/test/integration/integration_tests.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/completion_computer_test.dart
diff --git a/pkg/analysis_server/test/services/completion/completion_computer_test.dart b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
index e6bbcb68f32e36b8119aa07754ce7d8cc45ca6ab..dddf75ec3986f8a17731cbb05d7b86c00b9307e2 100644
--- a/pkg/analysis_server/test/services/completion/completion_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
@@ -94,26 +94,24 @@ class DartCompletionManagerTest extends AbstractSingleUnitTest {
switch (++count) {
case 1:
contributor1.assertCalls(context, source, 0, searchEngine);
+ expect(contributor1.fastCount, equals(1));
+ expect(contributor1.fullCount, equals(0));
contributor2.assertCalls(context, source, 0, searchEngine);
- expect(isLast, isFalse);
- expect(r.suggestions, hasLength(1));
- expect(r.suggestions, contains(suggestion1));
- resolveLibrary();
- break;
- case 2:
- contributor1.assertFull(0);
- contributor2.assertFull(1);
+ expect(contributor2.fastCount, equals(1));
+ expect(contributor2.fullCount, equals(1));
expect(isLast, isTrue);
expect(r.suggestions, hasLength(2));
expect(r.suggestions, contains(suggestion1));
expect(r.suggestions, contains(suggestion2));
+ resolveLibrary();
break;
default:
fail('unexpected');
}
}, onDone: () {
done = true;
- expect(count, equals(2));
+ // There is only one notification
+ expect(count, equals(1));
});
return pumpEventQueue().then((_) {
expect(done, isTrue);
@@ -134,7 +132,11 @@ class DartCompletionManagerTest extends AbstractSingleUnitTest {
switch (++count) {
case 1:
contributor1.assertCalls(context, source, 0, searchEngine);
+ expect(contributor1.fastCount, equals(1));
+ expect(contributor1.fullCount, equals(0));
contributor2.assertCalls(context, source, 0, searchEngine);
+ expect(contributor2.fastCount, equals(1));
+ expect(contributor2.fullCount, equals(0));
expect(isLast, isTrue);
expect(r.suggestions, hasLength(2));
expect(r.suggestions, contains(suggestion1));
@@ -170,14 +172,11 @@ class MockCompletionContributor extends DartCompletionContributor {
MockCompletionContributor(this.fastSuggestion, this.fullSuggestion);
- assertCalls(AnalysisContext context, Source source, int offset,
- SearchEngine searchEngine) {
+ assertCalls(AnalysisContext context, Source source, int offset, SearchEngine searchEngine) {
expect(request.context, equals(context));
expect(request.source, equals(source));
expect(request.offset, equals(offset));
expect(request.searchEngine, equals(searchEngine));
- expect(this.fastCount, equals(1));
- expect(this.fullCount, equals(0));
}
assertFull(int fullCount) {
« no previous file with comments | « pkg/analysis_server/test/integration/integration_tests.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698