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.context.directory.manager; | 5 library test.context.directory.manager; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analysis_server/src/context_manager.dart'; | 9 import 'package:analysis_server/src/context_manager.dart'; |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
11 import 'package:analyzer/file_system/memory_file_system.dart'; | 11 import 'package:analyzer/file_system/memory_file_system.dart'; |
12 import 'package:analyzer/instrumentation/instrumentation.dart'; | 12 import 'package:analyzer/instrumentation/instrumentation.dart'; |
13 import 'package:analyzer/src/generated/engine.dart'; | 13 import 'package:analyzer/src/generated/engine.dart'; |
14 import 'package:analyzer/src/generated/source.dart'; | 14 import 'package:analyzer/src/generated/source.dart'; |
15 import 'package:analyzer/src/generated/source_io.dart'; | 15 import 'package:analyzer/src/generated/source_io.dart'; |
16 import 'package:package_config/packages.dart'; | 16 import 'package:package_config/packages.dart'; |
17 import 'package:path/path.dart'; | 17 import 'package:path/path.dart'; |
18 import 'package:plugin/manager.dart'; | |
19 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 18 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
20 import 'package:unittest/unittest.dart'; | 19 import 'package:unittest/unittest.dart'; |
21 | 20 |
22 import 'mocks.dart'; | 21 import 'mocks.dart'; |
23 import 'utils.dart'; | 22 import 'utils.dart'; |
24 | 23 |
25 main() { | 24 main() { |
26 initializeTestEnvironment(); | 25 initializeTestEnvironment(); |
27 defineReflectiveTests(AbstractContextManagerTest); | 26 defineReflectiveTests(AbstractContextManagerTest); |
28 } | 27 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 82 } |
84 | 83 |
85 void setUp() { | 84 void setUp() { |
86 resourceProvider = new MemoryResourceProvider(); | 85 resourceProvider = new MemoryResourceProvider(); |
87 packageMapProvider = new MockPackageMapProvider(); | 86 packageMapProvider = new MockPackageMapProvider(); |
88 manager = new ContextManagerImpl(resourceProvider, providePackageResolver, | 87 manager = new ContextManagerImpl(resourceProvider, providePackageResolver, |
89 packageMapProvider, InstrumentationService.NULL_SERVICE); | 88 packageMapProvider, InstrumentationService.NULL_SERVICE); |
90 callbacks = new TestContextManagerCallbacks(resourceProvider); | 89 callbacks = new TestContextManagerCallbacks(resourceProvider); |
91 manager.callbacks = callbacks; | 90 manager.callbacks = callbacks; |
92 resourceProvider.newFolder(projPath); | 91 resourceProvider.newFolder(projPath); |
93 | |
94 // Options processing is required in context creation. | |
95 ExtensionManager em = new ExtensionManager(); | |
96 em.processPlugins([AnalysisEngine.instance.optionsPlugin]); | |
97 } | 92 } |
98 | 93 |
99 test_analysis_options_parse_failure() async { | 94 test_analysis_options_parse_failure() async { |
100 // Create files. | 95 // Create files. |
101 String libPath = newFolder([projPath, LIB_NAME]); | 96 String libPath = newFolder([projPath, LIB_NAME]); |
102 newFile([libPath, 'main.dart']); | 97 newFile([libPath, 'main.dart']); |
103 String sdkExtPath = newFolder([projPath, 'sdk_ext']); | 98 String sdkExtPath = newFolder([projPath, 'sdk_ext']); |
104 newFile([sdkExtPath, 'entry.dart']); | 99 newFile([sdkExtPath, 'entry.dart']); |
105 String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']); | 100 String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']); |
106 newFile([sdkExtSrcPath, 'part.dart']); | 101 newFile([sdkExtSrcPath, 'part.dart']); |
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1847 class TestUriResolver extends UriResolver { | 1842 class TestUriResolver extends UriResolver { |
1848 Map<Uri, Source> uriMap; | 1843 Map<Uri, Source> uriMap; |
1849 | 1844 |
1850 TestUriResolver(this.uriMap); | 1845 TestUriResolver(this.uriMap); |
1851 | 1846 |
1852 @override | 1847 @override |
1853 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 1848 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
1854 return uriMap[uri]; | 1849 return uriMap[uri]; |
1855 } | 1850 } |
1856 } | 1851 } |
OLD | NEW |