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 a4a374fb7ecf3e546acdebaa501cd6daaf8a4d53..4c8f4a25c08d51836264ef465b81dc8fc13f6b5a 100644 |
--- a/pkg/analyzer/test/src/context/abstract_context.dart |
+++ b/pkg/analyzer/test/src/context/abstract_context.dart |
@@ -14,6 +14,7 @@ import 'package:analyzer/src/generated/engine.dart' |
import 'package:analyzer/src/generated/sdk.dart'; |
import 'package:analyzer/src/generated/source.dart'; |
import 'package:analyzer/src/task/driver.dart'; |
+import 'package:analyzer/task/model.dart'; |
import 'package:unittest/unittest.dart'; |
import 'mock_sdk.dart'; |
@@ -27,6 +28,10 @@ class AbstractContextTest { |
AnalysisCache analysisCache; |
AnalysisDriver analysisDriver; |
+ AnalysisTask task; |
+ Map<ResultDescriptor<dynamic>, dynamic> oldOutputs; |
+ Map<ResultDescriptor<dynamic>, dynamic> outputs; |
+ |
Source addSource(String path, String contents) { |
Source source = newSource(path, contents); |
ChangeSet changeSet = new ChangeSet(); |
@@ -64,6 +69,17 @@ class AbstractContextTest { |
expect(elements, hasLength(names.length)); |
} |
+ /** |
+ * Compute the given [result] for the given [target]. |
+ */ |
+ void computeResult(AnalysisTarget target, ResultDescriptor result) { |
+ oldOutputs = outputs; |
+ task = analysisDriver.computeResult(target, result); |
+ expect(task, isNotNull); |
+ expect(task.caughtException, isNull); |
+ outputs = task.outputs; |
+ } |
+ |
AnalysisContextImpl createAnalysisContext() { |
return new AnalysisContextImpl(); |
} |