| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 analyzer.test.generated.inheritance_manager_test; | 5 library analyzer.test.generated.inheritance_manager_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| 11 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 11 import 'package:analyzer/src/dart/element/element.dart'; | 12 import 'package:analyzer/src/dart/element/element.dart'; |
| 12 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; | 13 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; |
| 13 import 'package:analyzer/src/generated/engine.dart'; | 14 import 'package:analyzer/src/generated/engine.dart'; |
| 14 import 'package:analyzer/src/generated/error.dart'; | 15 import 'package:analyzer/src/generated/error.dart'; |
| 15 import 'package:analyzer/src/generated/java_engine_io.dart'; | 16 import 'package:analyzer/src/generated/java_engine_io.dart'; |
| 16 import 'package:analyzer/src/generated/resolver.dart'; | 17 import 'package:analyzer/src/generated/resolver.dart'; |
| 17 import 'package:analyzer/src/generated/source_io.dart'; | 18 import 'package:analyzer/src/generated/source_io.dart'; |
| 18 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 19 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
| 19 import 'package:analyzer/src/generated/testing/element_factory.dart'; | 20 import 'package:analyzer/src/generated/testing/element_factory.dart'; |
| 20 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; | 21 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; |
| 21 import 'package:analyzer/src/generated/utilities_dart.dart'; | 22 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 23 import 'package:analyzer/src/source/source_resource.dart'; |
| 22 import 'package:unittest/unittest.dart'; | 24 import 'package:unittest/unittest.dart'; |
| 23 | 25 |
| 24 import '../reflective_tests.dart'; | 26 import '../reflective_tests.dart'; |
| 25 import '../utils.dart'; | 27 import '../utils.dart'; |
| 26 import 'analysis_context_factory.dart'; | 28 import 'analysis_context_factory.dart'; |
| 27 import 'test_support.dart'; | 29 import 'test_support.dart'; |
| 28 | 30 |
| 29 main() { | 31 main() { |
| 30 initializeTestEnvironment(); | 32 initializeTestEnvironment(); |
| 31 runReflectiveTests(InheritanceManagerTest); | 33 runReflectiveTests(InheritanceManagerTest); |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 void _assertNoErrors(ClassElement classElt) { | 1301 void _assertNoErrors(ClassElement classElt) { |
| 1300 _assertErrors(classElt); | 1302 _assertErrors(classElt); |
| 1301 } | 1303 } |
| 1302 | 1304 |
| 1303 /** | 1305 /** |
| 1304 * Create the inheritance manager used by the tests. | 1306 * Create the inheritance manager used by the tests. |
| 1305 * | 1307 * |
| 1306 * @return the inheritance manager that was created | 1308 * @return the inheritance manager that was created |
| 1307 */ | 1309 */ |
| 1308 InheritanceManager _createInheritanceManager() { | 1310 InheritanceManager _createInheritanceManager() { |
| 1309 AnalysisContext context = AnalysisContextFactory.contextWithCore(); | 1311 MemoryResourceProvider resourceProvider = new MemoryResourceProvider(); |
| 1310 FileBasedSource source = | 1312 AnalysisContext context = AnalysisContextFactory.contextWithCore( |
| 1311 new FileBasedSource(FileUtilities2.createFile("/test.dart")); | 1313 resourceProvider: resourceProvider); |
| 1314 Source source = new FileSource(resourceProvider.getFile("/test.dart")); |
| 1312 CompilationUnitElementImpl definingCompilationUnit = | 1315 CompilationUnitElementImpl definingCompilationUnit = |
| 1313 new CompilationUnitElementImpl("test.dart"); | 1316 new CompilationUnitElementImpl("test.dart"); |
| 1314 definingCompilationUnit.librarySource = | 1317 definingCompilationUnit.librarySource = |
| 1315 definingCompilationUnit.source = source; | 1318 definingCompilationUnit.source = source; |
| 1316 _definingLibrary = ElementFactory.library(context, "test"); | 1319 _definingLibrary = ElementFactory.library(context, "test"); |
| 1317 _definingLibrary.definingCompilationUnit = definingCompilationUnit; | 1320 _definingLibrary.definingCompilationUnit = definingCompilationUnit; |
| 1318 return new InheritanceManager(_definingLibrary); | 1321 return new InheritanceManager(_definingLibrary); |
| 1319 } | 1322 } |
| 1320 } | 1323 } |
| OLD | NEW |