OLD | NEW |
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/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 resolveLibrary(); | 106 resolveLibrary(); |
107 break; | 107 break; |
108 default: | 108 default: |
109 fail('unexpected'); | 109 fail('unexpected'); |
110 } | 110 } |
111 }, onDone: () { | 111 }, onDone: () { |
112 done = true; | 112 done = true; |
113 // There is only one notification | 113 // There is only one notification |
114 expect(count, equals(1)); | 114 expect(count, equals(1)); |
115 }); | 115 }); |
116 return pumpEventQueue().then((_) { | 116 return pumpEventQueue(150).then((_) { |
117 expect(done, isTrue); | 117 expect(done, isTrue); |
118 }); | 118 }); |
119 } | 119 } |
120 | 120 |
121 test_compute_fastOnly() { | 121 test_compute_fastOnly() { |
122 contributor1 = new MockCompletionContributor(suggestion1, null); | 122 contributor1 = new MockCompletionContributor(suggestion1, null); |
123 contributor2 = new MockCompletionContributor(suggestion2, null); | 123 contributor2 = new MockCompletionContributor(suggestion2, null); |
124 manager.contributors = [contributor1, contributor2]; | 124 manager.contributors = [contributor1, contributor2]; |
125 int count = 0; | 125 int count = 0; |
126 bool done = false; | 126 bool done = false; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 @override | 198 @override |
199 Future<bool> computeFull(DartCompletionRequest request) { | 199 Future<bool> computeFull(DartCompletionRequest request) { |
200 this.request = request; | 200 this.request = request; |
201 fullCount++; | 201 fullCount++; |
202 if (fullSuggestion != null) { | 202 if (fullSuggestion != null) { |
203 request.addSuggestion(fullSuggestion); | 203 request.addSuggestion(fullSuggestion); |
204 } | 204 } |
205 return new Future.value(fullSuggestion != null); | 205 return new Future.value(fullSuggestion != null); |
206 } | 206 } |
207 } | 207 } |
OLD | NEW |