| 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.manager; | 5 library test.services.completion.manager; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; | 7 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
| 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 11 | 11 |
| 12 import '../../abstract_context.dart'; | 12 import '../../abstract_context.dart'; |
| 13 import '../../reflective_tests.dart'; | 13 import '../../reflective_tests.dart'; |
| 14 | 14 |
| 15 main() { | 15 main() { |
| 16 groupSep = ' | '; | 16 groupSep = ' | '; |
| 17 runReflectiveTests(CompletionManagerTest); | 17 runReflectiveTests(CompletionManagerTest); |
| 18 } | 18 } |
| 19 | 19 |
| 20 @ReflectiveTestCase() | 20 @ReflectiveTestCase() |
| 21 class CompletionManagerTest extends AbstractContextTest { | 21 class CompletionManagerTest extends AbstractContextTest { |
| 22 var perf = new CompletionPerformance(); | 22 var perf = new CompletionPerformance(); |
| 23 var cache = null; | |
| 24 | 23 |
| 25 test_dart() { | 24 test_dart() { |
| 26 Source source = addSource('/does/not/exist.dart', ''); | 25 Source source = addSource('/does/not/exist.dart', ''); |
| 27 var manager = | 26 var manager = new CompletionManager.create(context, source, null); |
| 28 new CompletionManager.create(context, source, null, cache); | |
| 29 expect(manager.runtimeType, DartCompletionManager); | 27 expect(manager.runtimeType, DartCompletionManager); |
| 30 } | 28 } |
| 31 | 29 |
| 32 test_html() { | 30 test_html() { |
| 33 Source source = addSource('/does/not/exist.html', ''); | 31 Source source = addSource('/does/not/exist.html', ''); |
| 34 var manager = | 32 var manager = new CompletionManager.create(context, source, null); |
| 35 new CompletionManager.create(context, source, null, cache); | |
| 36 expect(manager.runtimeType, NoOpCompletionManager); | 33 expect(manager.runtimeType, NoOpCompletionManager); |
| 37 } | 34 } |
| 38 | 35 |
| 39 test_null_context() { | 36 test_null_context() { |
| 40 Source source = addSource('/does/not/exist.dart', ''); | 37 Source source = addSource('/does/not/exist.dart', ''); |
| 41 var manager = | 38 var manager = new CompletionManager.create(null, source, null); |
| 42 new CompletionManager.create(null, source, null, cache); | |
| 43 expect(manager.runtimeType, NoOpCompletionManager); | 39 expect(manager.runtimeType, NoOpCompletionManager); |
| 44 } | 40 } |
| 45 | 41 |
| 46 test_other() { | 42 test_other() { |
| 47 Source source = addSource('/does/not/exist.foo', ''); | 43 Source source = addSource('/does/not/exist.foo', ''); |
| 48 var manager = | 44 var manager = new CompletionManager.create(context, source, null); |
| 49 new CompletionManager.create(context, source, null, cache); | |
| 50 expect(manager.runtimeType, NoOpCompletionManager); | 45 expect(manager.runtimeType, NoOpCompletionManager); |
| 51 } | 46 } |
| 52 } | 47 } |
| OLD | NEW |