| 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.domain.completion; | 5 library test.domain.completion; |
| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 String id = params.id; | 351 String id = params.id; |
| 352 assertValidId(id); | 352 assertValidId(id); |
| 353 if (id == completionId) { | 353 if (id == completionId) { |
| 354 expect(suggestionsDone, isFalse); | 354 expect(suggestionsDone, isFalse); |
| 355 replacementOffset = params.replacementOffset; | 355 replacementOffset = params.replacementOffset; |
| 356 replacementLength = params.replacementLength; | 356 replacementLength = params.replacementLength; |
| 357 suggestionsDone = params.isLast; | 357 suggestionsDone = params.isLast; |
| 358 expect(suggestionsDone, isNotNull); | 358 expect(suggestionsDone, isNotNull); |
| 359 suggestions = params.results; | 359 suggestions = params.results; |
| 360 } | 360 } |
| 361 } else if (notification.event == SERVER_ERROR) { |
| 362 fail('server error: ${notification.toJson()}'); |
| 361 } | 363 } |
| 362 } | 364 } |
| 363 | 365 |
| 364 @override | 366 @override |
| 365 void setUp() { | 367 void setUp() { |
| 366 super.setUp(); | 368 super.setUp(); |
| 367 createProject(); | 369 createProject(); |
| 368 handler = new CompletionDomainHandler(server); | 370 handler = new CompletionDomainHandler(server); |
| 369 } | 371 } |
| 370 | 372 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 } | 846 } |
| 845 '''); | 847 '''); |
| 846 await waitForTasksFinished(); | 848 await waitForTasksFinished(); |
| 847 Request request = | 849 Request request = |
| 848 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); | 850 new CompletionGetSuggestionsParams(testFile, 0).toRequest('0'); |
| 849 Response response = handler.handleRequest(request); | 851 Response response = handler.handleRequest(request); |
| 850 expect(response.error, isNotNull); | 852 expect(response.error, isNotNull); |
| 851 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); | 853 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); |
| 852 } | 854 } |
| 853 } | 855 } |
| OLD | NEW |