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

Side by Side Diff: pkg/analysis_server/test/services/completion/completion_computer_test.dart

Issue 1398293002: Move the wire protocol support into the public API (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add missed files 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 unified diff | Download patch
OLDNEW
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.suggestion; 5 library test.services.completion.suggestion;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart';
9 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/protocol.dart';
11 import 'package:analysis_server/src/provisional/completion/completion_core.dart' 11 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
12 show CompletionRequest, CompletionResult; 12 show CompletionRequest, CompletionResult;
13 import 'package:analysis_server/src/services/completion/completion_manager.dart' ; 13 import 'package:analysis_server/src/services/completion/completion_manager.dart' ;
14 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; 14 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
15 import 'package:analysis_server/src/services/index/index.dart'; 15 import 'package:analysis_server/src/services/index/index.dart';
16 import 'package:analysis_server/src/services/index/local_memory_index.dart'; 16 import 'package:analysis_server/src/services/index/local_memory_index.dart';
17 import 'package:analysis_server/src/services/search/search_engine.dart'; 17 import 'package:analysis_server/src/services/search/search_engine.dart';
18 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ; 18 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ;
19 import 'package:analyzer/src/generated/engine.dart'; 19 import 'package:analyzer/src/generated/engine.dart';
20 import 'package:analyzer/src/generated/source.dart'; 20 import 'package:analyzer/src/generated/source.dart';
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 class MockCompletionContributor extends DartCompletionContributor { 166 class MockCompletionContributor extends DartCompletionContributor {
167 final CompletionSuggestion fastSuggestion; 167 final CompletionSuggestion fastSuggestion;
168 final CompletionSuggestion fullSuggestion; 168 final CompletionSuggestion fullSuggestion;
169 int fastCount = 0; 169 int fastCount = 0;
170 int fullCount = 0; 170 int fullCount = 0;
171 DartCompletionRequest request; 171 DartCompletionRequest request;
172 172
173 MockCompletionContributor(this.fastSuggestion, this.fullSuggestion); 173 MockCompletionContributor(this.fastSuggestion, this.fullSuggestion);
174 174
175 assertCalls(AnalysisContext context, Source source, int offset, SearchEngine s earchEngine) { 175 assertCalls(AnalysisContext context, Source source, int offset,
176 SearchEngine searchEngine) {
176 expect(request.context, equals(context)); 177 expect(request.context, equals(context));
177 expect(request.source, equals(source)); 178 expect(request.source, equals(source));
178 expect(request.offset, equals(offset)); 179 expect(request.offset, equals(offset));
179 expect(request.searchEngine, equals(searchEngine)); 180 expect(request.searchEngine, equals(searchEngine));
180 } 181 }
181 182
182 assertFull(int fullCount) { 183 assertFull(int fullCount) {
183 expect(this.fastCount, equals(1)); 184 expect(this.fastCount, equals(1));
184 expect(this.fullCount, equals(fullCount)); 185 expect(this.fullCount, equals(fullCount));
185 } 186 }
(...skipping 11 matching lines...) Expand all
197 @override 198 @override
198 Future<bool> computeFull(DartCompletionRequest request) { 199 Future<bool> computeFull(DartCompletionRequest request) {
199 this.request = request; 200 this.request = request;
200 fullCount++; 201 fullCount++;
201 if (fullSuggestion != null) { 202 if (fullSuggestion != null) {
202 request.addSuggestion(fullSuggestion); 203 request.addSuggestion(fullSuggestion);
203 } 204 }
204 return new Future.value(fullSuggestion != null); 205 return new Future.value(fullSuggestion != null);
205 } 206 }
206 } 207 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698