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

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

Issue 1185443002: Support for parsing HTML in the new task model (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
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();
}

Powered by Google App Engine
This is Rietveld 408576698