Index: pkg/analysis_server/test/abstract_single_unit.dart |
diff --git a/pkg/analysis_server/test/abstract_single_unit.dart b/pkg/analysis_server/test/abstract_single_unit.dart |
index bc8fe5c102722cea5275c8cda9812753140a6ae6..30d66dd50cfa3f44667f78c50b2072368d29126e 100644 |
--- a/pkg/analysis_server/test/abstract_single_unit.dart |
+++ b/pkg/analysis_server/test/abstract_single_unit.dart |
@@ -7,6 +7,7 @@ import 'dart:async'; |
import 'package:analyzer/dart/ast/ast.dart'; |
import 'package:analyzer/dart/element/element.dart'; |
import 'package:analyzer/error/error.dart'; |
+import 'package:analyzer/src/dart/analysis/driver.dart'; |
import 'package:analyzer/src/dart/ast/utilities.dart'; |
import 'package:analyzer/src/dart/error/hint_codes.dart'; |
import 'package:analyzer/src/generated/java_engine.dart'; |
@@ -96,25 +97,18 @@ class AbstractSingleUnitTest extends AbstractContextTest { |
Future<Null> resolveTestUnit(String code) async { |
addTestSource(code); |
- if (enableNewAnalysisDriver) { |
- var result = await driver.getResult(testFile); |
- testUnit = (result).unit; |
- if (verifyNoTestUnitErrors) { |
- expect(result.errors.where((AnalysisError error) { |
- return error.errorCode != HintCode.DEAD_CODE && |
- error.errorCode != HintCode.UNUSED_CATCH_CLAUSE && |
- error.errorCode != HintCode.UNUSED_CATCH_STACK && |
- error.errorCode != HintCode.UNUSED_ELEMENT && |
- error.errorCode != HintCode.UNUSED_FIELD && |
- error.errorCode != HintCode.UNUSED_IMPORT && |
- error.errorCode != HintCode.UNUSED_LOCAL_VARIABLE; |
- }), isEmpty); |
- } |
- } else { |
- testUnit = await resolveLibraryUnit(testSource); |
- if (verifyNoTestUnitErrors) { |
- expect(context.getErrors(testSource).errors, isEmpty); |
- } |
+ AnalysisResult result = await driver.getResult(testFile); |
+ testUnit = result.unit; |
+ if (verifyNoTestUnitErrors) { |
+ expect(result.errors.where((AnalysisError error) { |
+ return error.errorCode != HintCode.DEAD_CODE && |
+ error.errorCode != HintCode.UNUSED_CATCH_CLAUSE && |
+ error.errorCode != HintCode.UNUSED_CATCH_STACK && |
+ error.errorCode != HintCode.UNUSED_ELEMENT && |
+ error.errorCode != HintCode.UNUSED_FIELD && |
+ error.errorCode != HintCode.UNUSED_IMPORT && |
+ error.errorCode != HintCode.UNUSED_LOCAL_VARIABLE; |
+ }), isEmpty); |
} |
testUnitElement = testUnit.element; |
testLibraryElement = testUnitElement.library; |