Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Unified Diff: pkg/analyzer/test/src/context/abstract_context.dart

Issue 1124053003: Use AbstractContextTest for AnalysisContextImplTest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698