| 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.toplevel; | 5 library test.services.completion.toplevel; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
| 8 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; | 9 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; |
| 9 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 10 import 'package:analysis_server/src/services/completion/imported_computer.dart'; | 11 import 'package:analysis_server/src/services/completion/imported_computer.dart'; |
| 11 import 'package:analyzer/src/generated/engine.dart'; | 12 import 'package:analyzer/src/generated/engine.dart'; |
| 12 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
| 13 | 14 |
| 14 import '../../reflective_tests.dart'; | 15 import '../../reflective_tests.dart'; |
| 15 import 'completion_test_util.dart'; | 16 import 'completion_test_util.dart'; |
| 16 | 17 |
| 17 main() { | 18 main() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 48 context.applyChanges(changes); | 49 context.applyChanges(changes); |
| 49 /* | 50 /* |
| 50 * Calculate a new completion at the same location | 51 * Calculate a new completion at the same location |
| 51 */ | 52 */ |
| 52 setUpComputer(); | 53 setUpComputer(); |
| 53 request = new DartCompletionRequest( | 54 request = new DartCompletionRequest( |
| 54 context, | 55 context, |
| 55 searchEngine, | 56 searchEngine, |
| 56 testSource, | 57 testSource, |
| 57 completionOffset, | 58 completionOffset, |
| 58 cache); | 59 cache, |
| 60 new CompletionPerformance()); |
| 59 expect(computeFast(), isTrue); | 61 expect(computeFast(), isTrue); |
| 60 expect(request.unit.element, isNull); | 62 expect(request.unit.element, isNull); |
| 61 List<CompletionSuggestion> newSuggestions = request.suggestions; | 63 List<CompletionSuggestion> newSuggestions = request.suggestions; |
| 62 if (newSuggestions.length == oldSuggestions.length) { | 64 if (newSuggestions.length == oldSuggestions.length) { |
| 63 if (!oldSuggestions.any( | 65 if (!oldSuggestions.any( |
| 64 (CompletionSuggestion s) => !newSuggestions.contains(s))) { | 66 (CompletionSuggestion s) => !newSuggestions.contains(s))) { |
| 65 return; | 67 return; |
| 66 } | 68 } |
| 67 } | 69 } |
| 68 StringBuffer sb = new StringBuffer( | 70 StringBuffer sb = new StringBuffer( |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 test_Block_inherited_imported() { | 138 test_Block_inherited_imported() { |
| 137 return super.test_Block_inherited_imported().then((_) { | 139 return super.test_Block_inherited_imported().then((_) { |
| 138 assertCached('E'); | 140 assertCached('E'); |
| 139 assertCached('F'); | 141 assertCached('F'); |
| 140 assertNotCached('e1'); | 142 assertNotCached('e1'); |
| 141 assertNotCached('i2'); | 143 assertNotCached('i2'); |
| 142 assertNotCached('m1'); | 144 assertNotCached('m1'); |
| 143 }); | 145 }); |
| 144 } | 146 } |
| 145 } | 147 } |
| OLD | NEW |