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

Unified Diff: pkg/analyzer/test/generated/element_resolver_test.dart

Issue 2625203002: Run the rest of the analysis tests with the new analysis driver. (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
Index: pkg/analyzer/test/generated/element_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/element_resolver_test.dart b/pkg/analyzer/test/generated/element_resolver_test.dart
index 277a2c736870eb931391008a01964292642026c5..26c6ab060d9cf6cc0a263038c9f3e60758d68988 100644
--- a/pkg/analyzer/test/generated/element_resolver_test.dart
+++ b/pkg/analyzer/test/generated/element_resolver_test.dart
@@ -4,9 +4,11 @@
library analyzer.test.generated.element_resolver_test;
+import 'dart:async';
+
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_resolution_map.dart';
import 'package:analyzer/dart/ast/standard_ast_factory.dart';
+import 'package:analyzer/dart/ast/standard_resolution_map.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
@@ -36,7 +38,7 @@ main() {
@reflectiveTest
class ElementResolverCodeTest extends ResolverTestCase {
- void test_annotation_class_namedConstructor() {
+ test_annotation_class_namedConstructor() async {
addNamedSource(
'/a.dart',
r'''
@@ -44,7 +46,7 @@ class A {
const A.named();
}
''');
- _validateAnnotation('', '@A.named()', (SimpleIdentifier name1,
+ await _validateAnnotation('', '@A.named()', (SimpleIdentifier name1,
SimpleIdentifier name2,
SimpleIdentifier name3,
Element annotationElement) {
@@ -68,7 +70,7 @@ class A {
});
}
- void test_annotation_class_prefixed_namedConstructor() {
+ test_annotation_class_prefixed_namedConstructor() async {
addNamedSource(
'/a.dart',
r'''
@@ -76,7 +78,7 @@ class A {
const A.named();
}
''');
- _validateAnnotation('as p', '@p.A.named()', (SimpleIdentifier name1,
+ await _validateAnnotation('as p', '@p.A.named()', (SimpleIdentifier name1,
SimpleIdentifier name2,
SimpleIdentifier name3,
Element annotationElement) {
@@ -102,7 +104,7 @@ class A {
});
}
- void test_annotation_class_prefixed_staticConstField() {
+ test_annotation_class_prefixed_staticConstField() async {
addNamedSource(
'/a.dart',
r'''
@@ -110,7 +112,7 @@ class A {
static const V = 0;
}
''');
- _validateAnnotation('as p', '@p.A.V', (SimpleIdentifier name1,
+ await _validateAnnotation('as p', '@p.A.V', (SimpleIdentifier name1,
SimpleIdentifier name2,
SimpleIdentifier name3,
Element annotationElement) {
@@ -134,7 +136,7 @@ class A {
});
}
- void test_annotation_class_prefixed_unnamedConstructor() {
+ test_annotation_class_prefixed_unnamedConstructor() async {
addNamedSource(
'/a.dart',
r'''
@@ -142,7 +144,7 @@ class A {
const A();
}
''');
- _validateAnnotation('as p', '@p.A', (SimpleIdentifier name1,
+ await _validateAnnotation('as p', '@p.A', (SimpleIdentifier name1,
SimpleIdentifier name2,
SimpleIdentifier name3,
Element annotationElement) {
@@ -164,7 +166,7 @@ class A {
});
}
- void test_annotation_class_staticConstField() {
+ test_annotation_class_staticConstField() async {
addNamedSource(
'/a.dart',
r'''
@@ -172,7 +174,7 @@ class A {
static const V = 0;
}
''');
- _validateAnnotation('', '@A.V', (SimpleIdentifier name1,
+ await _validateAnnotation('', '@A.V', (SimpleIdentifier name1,
SimpleIdentifier name2,
SimpleIdentifier name3,
Element annotationElement) {
@@ -194,7 +196,7 @@ class A {
});
}
- void test_annotation_class_unnamedConstructor() {
+ test_annotation_class_unnamedConstructor() async {
addNamedSource(
'/a.dart',
r'''
@@ -202,7 +204,7 @@ class A {
const A();
}
''');
- _validateAnnotation('', '@A', (SimpleIdentifier name1,
+ await _validateAnnotation('', '@A', (SimpleIdentifier name1,
SimpleIdentifier name2,
SimpleIdentifier name3,
Element annotationElement) {
@@ -222,13 +224,13 @@ class A {
});
}
- void test_annotation_topLevelVariable() {
+ test_annotation_topLevelVariable() async {
addNamedSource(
'/a.dart',
r'''
const V = 0;
''');
- _validateAnnotation('', '@V', (SimpleIdentifier name1,
+ await _validateAnnotation('', '@V', (SimpleIdentifier name1,
SimpleIdentifier name2,
SimpleIdentifier name3,
Element annotationElement) {
@@ -249,13 +251,13 @@ const V = 0;
});
}
- void test_annotation_topLevelVariable_prefixed() {
+ test_annotation_topLevelVariable_prefixed() async {
addNamedSource(
'/a.dart',
r'''
const V = 0;
''');
- _validateAnnotation('as p', '@p.V', (SimpleIdentifier name1,
+ await _validateAnnotation('as p', '@p.V', (SimpleIdentifier name1,
SimpleIdentifier name2,
SimpleIdentifier name3,
Element annotationElement) {
@@ -278,12 +280,12 @@ const V = 0;
});
}
- void _validateAnnotation(
+ Future<Null> _validateAnnotation(
String annotationPrefix,
String annotationText,
validator(SimpleIdentifier name1, SimpleIdentifier name2,
- SimpleIdentifier name3, Element annotationElement)) {
- CompilationUnit unit = resolveSource('''
+ SimpleIdentifier name3, Element annotationElement)) async {
+ CompilationUnit unit = await resolveSource('''
import 'a.dart' $annotationPrefix;
$annotationText
class C {}
@@ -387,7 +389,7 @@ class ElementResolverTest extends EngineTestCase {
_resolver = _createResolver();
}
- void test_lookUpMethodInInterfaces() {
+ test_lookUpMethodInInterfaces() async {
InterfaceType intType = _typeProvider.intType;
//
// abstract class A { int operator[](int index); }
@@ -422,7 +424,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitAssignmentExpression_compound() {
+ test_visitAssignmentExpression_compound() async {
InterfaceType intType = _typeProvider.intType;
SimpleIdentifier leftHandSide = AstTestFactory.identifier3("a");
leftHandSide.staticType = intType;
@@ -434,7 +436,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitAssignmentExpression_simple() {
+ test_visitAssignmentExpression_simple() async {
AssignmentExpression expression = AstTestFactory.assignmentExpression(
AstTestFactory.identifier3("x"),
TokenType.EQ,
@@ -444,7 +446,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitBinaryExpression_bangEq() {
+ test_visitBinaryExpression_bangEq() async {
// String i;
// var j;
// i == j
@@ -464,7 +466,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitBinaryExpression_eq() {
+ test_visitBinaryExpression_eq() async {
// String i;
// var j;
// i == j
@@ -483,7 +485,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitBinaryExpression_plus() {
+ test_visitBinaryExpression_plus() async {
// num i;
// var j;
// i + j
@@ -498,7 +500,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitBinaryExpression_plus_propagatedElement() {
+ test_visitBinaryExpression_plus_propagatedElement() async {
// var i = 1;
// var j;
// i + j
@@ -513,7 +515,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitBreakStatement_withLabel() {
+ test_visitBreakStatement_withLabel() async {
// loop: while (true) {
// break loop;
// }
@@ -530,13 +532,13 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitBreakStatement_withoutLabel() {
+ test_visitBreakStatement_withoutLabel() async {
BreakStatement statement = AstTestFactory.breakStatement();
_resolveStatement(statement, null, null);
_listener.assertNoErrors();
}
- void test_visitCommentReference_prefixedIdentifier_class_getter() {
+ test_visitCommentReference_prefixedIdentifier_class_getter() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
// set accessors
String propName = "p";
@@ -559,7 +561,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitCommentReference_prefixedIdentifier_class_method() {
+ test_visitCommentReference_prefixedIdentifier_class_method() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
// set method
MethodElement method =
@@ -579,7 +581,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitCommentReference_prefixedIdentifier_class_operator() {
+ test_visitCommentReference_prefixedIdentifier_class_operator() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
// set method
MethodElement method =
@@ -599,7 +601,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitConstructorName_named() {
+ test_visitConstructorName_named() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String constructorName = "a";
ConstructorElement constructor =
@@ -612,7 +614,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitConstructorName_unnamed() {
+ test_visitConstructorName_unnamed() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String constructorName = null;
ConstructorElement constructor =
@@ -625,7 +627,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitContinueStatement_withLabel() {
+ test_visitContinueStatement_withLabel() async {
// loop: while (true) {
// continue loop;
// }
@@ -643,13 +645,13 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitContinueStatement_withoutLabel() {
+ test_visitContinueStatement_withoutLabel() async {
ContinueStatement statement = AstTestFactory.continueStatement();
_resolveStatement(statement, null, null);
_listener.assertNoErrors();
}
- void test_visitEnumDeclaration() {
+ test_visitEnumDeclaration() async {
CompilationUnitElementImpl compilationUnitElement =
ElementFactory.compilationUnit('foo.dart');
EnumElementImpl enumElement =
@@ -670,7 +672,7 @@ class ElementResolverTest extends EngineTestCase {
expect(metadata[0].element, annotationNode.element);
}
- void test_visitExportDirective_noCombinators() {
+ test_visitExportDirective_noCombinators() async {
ExportDirective directive = AstTestFactory.exportDirective2(null);
directive.element = ElementFactory
.exportFor(ElementFactory.library(_definingLibrary.context, "lib"));
@@ -678,7 +680,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitFieldFormalParameter() {
+ test_visitFieldFormalParameter() async {
String fieldName = "f";
InterfaceType intType = _typeProvider.intType;
FieldElementImpl fieldElement =
@@ -697,7 +699,7 @@ class ElementResolverTest extends EngineTestCase {
same(intType));
}
- void test_visitImportDirective_noCombinators_noPrefix() {
+ test_visitImportDirective_noCombinators_noPrefix() async {
ImportDirective directive = AstTestFactory.importDirective3(null, null);
directive.element = ElementFactory.importFor(
ElementFactory.library(_definingLibrary.context, "lib"), null);
@@ -705,7 +707,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitImportDirective_noCombinators_prefix() {
+ test_visitImportDirective_noCombinators_prefix() async {
String prefixName = "p";
ImportElement importElement = ElementFactory.importFor(
ElementFactory.library(_definingLibrary.context, "lib"),
@@ -718,7 +720,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitImportDirective_withCombinators() {
+ test_visitImportDirective_withCombinators() async {
ShowCombinator combinator = AstTestFactory.showCombinator2(["A", "B", "C"]);
ImportDirective directive =
AstTestFactory.importDirective3(null, null, [combinator]);
@@ -747,7 +749,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitIndexExpression_get() {
+ test_visitIndexExpression_get() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
InterfaceType intType = _typeProvider.intType;
MethodElement getter =
@@ -761,7 +763,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitIndexExpression_set() {
+ test_visitIndexExpression_set() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
InterfaceType intType = _typeProvider.intType;
MethodElement setter =
@@ -777,7 +779,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitInstanceCreationExpression_named() {
+ test_visitInstanceCreationExpression_named() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String constructorName = "a";
ConstructorElement constructor =
@@ -793,7 +795,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitInstanceCreationExpression_unnamed() {
+ test_visitInstanceCreationExpression_unnamed() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String constructorName = null;
ConstructorElement constructor =
@@ -809,7 +811,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitInstanceCreationExpression_unnamed_namedParameter() {
+ test_visitInstanceCreationExpression_unnamed_namedParameter() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String constructorName = null;
ConstructorElementImpl constructor =
@@ -836,7 +838,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitMethodInvocation() {
+ test_visitMethodInvocation() async {
InterfaceType numType = _typeProvider.numType;
SimpleIdentifier left = AstTestFactory.identifier3("i");
left.staticType = numType;
@@ -849,7 +851,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitMethodInvocation_namedParameter() {
+ test_visitMethodInvocation_namedParameter() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String methodName = "m";
String parameterName = "p";
@@ -874,7 +876,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPostfixExpression() {
+ test_visitPostfixExpression() async {
InterfaceType numType = _typeProvider.numType;
SimpleIdentifier operand = AstTestFactory.identifier3("i");
operand.staticType = numType;
@@ -885,7 +887,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPrefixedIdentifier_dynamic() {
+ test_visitPrefixedIdentifier_dynamic() async {
DartType dynamicType = _typeProvider.dynamicType;
SimpleIdentifier target = AstTestFactory.identifier3("a");
VariableElementImpl variable = ElementFactory.localVariableElement(target);
@@ -900,7 +902,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPrefixedIdentifier_nonDynamic() {
+ test_visitPrefixedIdentifier_nonDynamic() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String getterName = "b";
PropertyAccessorElement getter =
@@ -919,7 +921,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPrefixedIdentifier_staticClassMember_getter() {
+ test_visitPrefixedIdentifier_staticClassMember_getter() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
// set accessors
String propName = "b";
@@ -941,7 +943,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPrefixedIdentifier_staticClassMember_method() {
+ test_visitPrefixedIdentifier_staticClassMember_method() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
// set methods
String propName = "m";
@@ -963,7 +965,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPrefixedIdentifier_staticClassMember_setter() {
+ test_visitPrefixedIdentifier_staticClassMember_setter() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
// set accessors
String propName = "b";
@@ -987,7 +989,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPrefixExpression() {
+ test_visitPrefixExpression() async {
InterfaceType numType = _typeProvider.numType;
SimpleIdentifier operand = AstTestFactory.identifier3("i");
operand.staticType = numType;
@@ -998,7 +1000,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPropertyAccess_getter_identifier() {
+ test_visitPropertyAccess_getter_identifier() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String getterName = "b";
PropertyAccessorElement getter =
@@ -1012,7 +1014,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPropertyAccess_getter_super() {
+ test_visitPropertyAccess_getter_super() async {
//
// class A {
// int get b;
@@ -1042,7 +1044,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitPropertyAccess_setter_this() {
+ test_visitPropertyAccess_setter_this() async {
ClassElementImpl classA = ElementFactory.classElement2("A");
String setterName = "b";
PropertyAccessorElement setter =
@@ -1058,7 +1060,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitSimpleIdentifier_classScope() {
+ test_visitSimpleIdentifier_classScope() async {
InterfaceType doubleType = _typeProvider.doubleType;
String fieldName = "NAN";
SimpleIdentifier node = AstTestFactory.identifier3(fieldName);
@@ -1067,7 +1069,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitSimpleIdentifier_dynamic() {
+ test_visitSimpleIdentifier_dynamic() async {
SimpleIdentifier node = AstTestFactory.identifier3("dynamic");
_resolveIdentifier(node);
expect(node.staticElement, same(_typeProvider.dynamicType.element));
@@ -1075,14 +1077,14 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitSimpleIdentifier_lexicalScope() {
+ test_visitSimpleIdentifier_lexicalScope() async {
SimpleIdentifier node = AstTestFactory.identifier3("i");
VariableElementImpl element = ElementFactory.localVariableElement(node);
expect(_resolveIdentifier(node, [element]), same(element));
_listener.assertNoErrors();
}
- void test_visitSimpleIdentifier_lexicalScope_field_setter() {
+ test_visitSimpleIdentifier_lexicalScope_field_setter() async {
InterfaceType intType = _typeProvider.intType;
ClassElementImpl classA = ElementFactory.classElement2("A");
String fieldName = "a";
@@ -1101,7 +1103,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitSuperConstructorInvocation() {
+ test_visitSuperConstructorInvocation() async {
ClassElementImpl superclass = ElementFactory.classElement2("A");
ConstructorElementImpl superConstructor =
ElementFactory.constructorElement2(superclass, null);
@@ -1121,7 +1123,7 @@ class ElementResolverTest extends EngineTestCase {
_listener.assertNoErrors();
}
- void test_visitSuperConstructorInvocation_namedParameter() {
+ test_visitSuperConstructorInvocation_namedParameter() async {
ClassElementImpl superclass = ElementFactory.classElement2("A");
ConstructorElementImpl superConstructor =
ElementFactory.constructorElement2(superclass, null);
« no previous file with comments | « pkg/analyzer/test/generated/declaration_resolver_test.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698