Index: pkg/analyzer/test/src/context/abstract_context.dart |
diff --git a/pkg/analyzer/test/src/context/abstract_context.dart b/pkg/analyzer/test/src/context/abstract_context.dart |
index 45925cd0da502e6e6326e0991a477adc32c7d96e..e1f7a3939233252d54a8540ac43512d194470d09 100644 |
--- a/pkg/analyzer/test/src/context/abstract_context.dart |
+++ b/pkg/analyzer/test/src/context/abstract_context.dart |
@@ -26,11 +26,21 @@ class AbstractContextTest { |
ExtensionManager extensionManager = new ExtensionManager(); |
DartSdk sdk = new MockSdk(); |
+ SourceFactory sourceFactory; |
AnalysisContextImpl context; |
TaskManager taskManager = new TaskManager(); |
AnalysisDriver analysisDriver; |
+ Source addSource(String path, String contents) { |
+ Source source = newSource(path, contents); |
+ ChangeSet changeSet = new ChangeSet(); |
+ changeSet.addedSource(source); |
+ context.applyChanges(changeSet); |
+ context.setContents(source, contents); |
+ return source; |
+ } |
+ |
/** |
* Assert that the given [elements] has the same number of items as the number |
* of specified [names], and that for each specified name, a corresponding |
@@ -82,15 +92,18 @@ class AbstractContextTest { |
// configure TaskManager |
{ |
EnginePlugin plugin = AnalysisEngine.instance.enginePlugin; |
- extensionManager.processPlugins([plugin]); |
+ if (plugin.taskExtensionPoint == null) { |
+ extensionManager.processPlugins([plugin]); |
+ } |
taskManager.addTaskDescriptors(plugin.taskDescriptors); |
} |
// prepare AnalysisContext |
- context = createAnalysisContext(); |
- context.sourceFactory = new SourceFactory(<UriResolver>[ |
+ sourceFactory = new SourceFactory(<UriResolver>[ |
new DartUriResolver(sdk), |
new ResourceUriResolver(resourceProvider) |
]); |
+ context = createAnalysisContext(); |
+ context.sourceFactory = sourceFactory; |
// prepare AnalysisDriver |
analysisDriver = new AnalysisDriver(taskManager, context); |
} |