| 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.dart.manager; | 5 library test.services.completion.dart.manager; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
| 10 import 'package:analysis_server/src/services/completion/completion_core.dart'; | 10 import 'package:analysis_server/src/services/completion/completion_core.dart'; |
| 11 import 'package:analysis_server/src/services/completion/completion_performance.d
art'; | 11 import 'package:analysis_server/src/services/completion/completion_performance.d
art'; |
| 12 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart'; | 12 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart'; |
| 13 import 'package:analysis_server/src/services/completion/dart/imported_reference_
contributor.dart'; | 13 import 'package:analysis_server/src/services/completion/dart/imported_reference_
contributor.dart'; |
| 14 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 14 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
| 15 import 'package:analyzer/dart/element/element.dart'; | 15 import 'package:analyzer/dart/element/element.dart'; |
| 16 import 'package:analyzer/src/task/dart.dart'; | 16 import 'package:analyzer/src/task/dart.dart'; |
| 17 import 'package:test/test.dart'; | 17 import 'package:test/test.dart'; |
| 18 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 18 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 19 | 19 |
| 20 import 'completion_contributor_util.dart'; | 20 import 'completion_contributor_util.dart'; |
| 21 | 21 |
| 22 main() { | 22 main() { |
| 23 defineReflectiveSuite(() { | 23 defineReflectiveSuite(() { |
| 24 defineReflectiveTests(CompletionManagerTest); | 24 defineReflectiveTests(CompletionManagerTest); |
| 25 defineReflectiveTests(CompletionManagerTest_Driver); | |
| 26 }); | 25 }); |
| 27 } | 26 } |
| 28 | 27 |
| 29 @reflectiveTest | 28 @reflectiveTest |
| 30 class CompletionManagerTest extends DartCompletionContributorTest { | 29 class CompletionManagerTest extends DartCompletionContributorTest { |
| 31 @override | 30 @override |
| 31 bool get enableNewAnalysisDriver => true; |
| 32 |
| 33 @override |
| 32 DartCompletionContributor createContributor() { | 34 DartCompletionContributor createContributor() { |
| 33 return new ImportedReferenceContributor(); | 35 return new ImportedReferenceContributor(); |
| 34 } | 36 } |
| 35 | 37 |
| 36 test_resolveDirectives() async { | 38 test_resolveDirectives() async { |
| 37 addSource( | 39 addSource( |
| 38 '/libA.dart', | 40 '/libA.dart', |
| 39 ''' | 41 ''' |
| 40 library libA; | 42 library libA; |
| 41 /// My class. | 43 /// My class. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 void assertImportedLib(String expectedUri) { | 106 void assertImportedLib(String expectedUri) { |
| 105 ImportElement importElem = importNamed(expectedUri); | 107 ImportElement importElem = importNamed(expectedUri); |
| 106 expect(importElem.importedLibrary.exportNamespace, isNotNull); | 108 expect(importElem.importedLibrary.exportNamespace, isNotNull); |
| 107 } | 109 } |
| 108 | 110 |
| 109 // Assert that the new imports each have an export namespace | 111 // Assert that the new imports each have an export namespace |
| 110 assertImportedLib(null /* dart:core */); | 112 assertImportedLib(null /* dart:core */); |
| 111 assertImportedLib('/libA.dart'); | 113 assertImportedLib('/libA.dart'); |
| 112 } | 114 } |
| 113 } | 115 } |
| 114 | |
| 115 @reflectiveTest | |
| 116 class CompletionManagerTest_Driver extends CompletionManagerTest { | |
| 117 @override | |
| 118 bool get enableNewAnalysisDriver => true; | |
| 119 } | |
| OLD | NEW |