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

Unified Diff: pkg/analysis_server/test/abstract_context.dart

Issue 2614033003: Make subclasses of AbstractContextTest asynchronous. (Closed)
Patch Set: Created 3 years, 11 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/analysis_server/test/abstract_single_unit.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/abstract_context.dart
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index ac7d8c0cfb8015a99db98f4ec894d5356c8e1e1f..ed9bb2f48e18b7a6f1d132e62a6a39cb9f61cd49 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -4,6 +4,8 @@
library testing.abstract_context;
+import 'dart:async';
+
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/visitor.dart';
@@ -123,12 +125,12 @@ class AbstractContextTest {
AnalysisEngine.instance.processRequiredPlugins();
}
- CompilationUnit resolveDartUnit(Source unitSource, Source librarySource) {
- return context.resolveCompilationUnit2(unitSource, librarySource);
- }
-
- CompilationUnit resolveLibraryUnit(Source source) {
- return context.resolveCompilationUnit2(source, source);
+ Future<CompilationUnit> resolveLibraryUnit(Source source) async {
+ if (enableNewAnalysisDriver) {
+ return (await driver.getResult(source.fullName))?.unit;
+ } else {
+ return context.resolveCompilationUnit2(source, source);
+ }
}
void setUp() {
« no previous file with comments | « no previous file | pkg/analysis_server/test/abstract_single_unit.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698