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

Unified Diff: pkg/analysis_server/test/services/search/search_engine_test.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
Index: pkg/analysis_server/test/services/search/search_engine_test.dart
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index 24c0a9f358ba35330192f72adc904ebbdde82177..152364dbf5aa7a3f17e50d174d3b0fe84dbbd02a 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -75,7 +75,7 @@ class SearchEngineImplTest extends AbstractSingleUnitTest {
}
test_searchAllSubtypes() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class T {}
class A extends T {}
class B extends A {}
@@ -90,7 +90,7 @@ class C implements B {}
}
test_searchMemberDeclarations() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
test() {}
}
@@ -114,7 +114,7 @@ class B {
}
test_searchMemberReferences_qualified_resolved() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class C {
var test;
}
@@ -131,7 +131,7 @@ main(C c) {
}
test_searchMemberReferences_qualified_unresolved() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
main(p) {
print(p.test);
p.test = 1;
@@ -152,7 +152,7 @@ main(p) {
}
test_searchMemberReferences_unqualified_resolved() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class C {
var test;
main() {
@@ -170,7 +170,7 @@ class C {
test_searchMemberReferences_unqualified_unresolved() async {
verifyNoTestUnitErrors = false;
- _indexTestUnit('''
+ await _indexTestUnit('''
class C {
main() {
print(test);
@@ -193,7 +193,7 @@ class C {
}
test_searchReferences_ClassElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {}
main(A p) {
A v;
@@ -215,7 +215,7 @@ main(A p) {
'''
part of lib;
''');
- _indexTestUnit('''
+ await _indexTestUnit('''
library lib;
part 'my_part.dart';
''');
@@ -228,7 +228,7 @@ part 'my_part.dart';
}
test_searchReferences_ConstructorElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
A.named() {}
}
@@ -245,7 +245,7 @@ main() {
}
test_searchReferences_ConstructorElement_synthetic() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
}
main() {
@@ -266,7 +266,7 @@ main() {
}
test_searchReferences_FieldElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
var field;
A({this.field});
@@ -300,7 +300,7 @@ class A {
}
test_searchReferences_FieldElement_ofEnum() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
enum MyEnum {
A, B, C
}
@@ -326,7 +326,7 @@ main() {
}
test_searchReferences_FieldElement_synthetic() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
get field => null;
set field(x) {}
@@ -356,7 +356,7 @@ class A {
}
test_searchReferences_FunctionElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
test() {}
main() {
test();
@@ -373,7 +373,7 @@ main() {
}
test_searchReferences_FunctionElement_local() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
main() {
test() {}
test();
@@ -390,7 +390,7 @@ main() {
}
test_searchReferences_FunctionTypeAliasElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
typedef Test();
main() {
Test a;
@@ -408,7 +408,7 @@ main() {
}
test_searchReferences_ImportElement_noPrefix() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
import 'dart:math' show max, PI, Random hide min;
export 'dart:math' show max, PI, Random hide min;
main() {
@@ -432,7 +432,7 @@ Random bar() => null;
}
test_searchReferences_ImportElement_withPrefix() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
import 'dart:math' as math show max, PI, Random hide min;
export 'dart:math' show max, PI, Random hide min;
main() {
@@ -457,7 +457,7 @@ math.Random bar() => null;
}
test_searchReferences_ImportElement_withPrefix_forMultipleImports() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
import 'dart:async' as p;
import 'dart:math' as p;
main() {
@@ -485,7 +485,7 @@ main() {
}
test_searchReferences_LabelElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
main() {
label:
while (true) {
@@ -510,7 +510,7 @@ label:
var codeB = 'part of lib; // B';
addSource('/unitA.dart', codeA);
addSource('/unitB.dart', codeB);
- _indexTestUnit('''
+ await _indexTestUnit('''
library lib;
part 'unitA.dart';
part 'unitB.dart';
@@ -530,7 +530,7 @@ part 'unitB.dart';
}
test_searchReferences_LocalVariableElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
main() {
var v;
v = 1;
@@ -551,7 +551,7 @@ main() {
}
test_searchReferences_LocalVariableElement_inForEachLoop() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
main() {
for (var v in []) {
v = 1;
@@ -573,7 +573,7 @@ main() {
}
test_searchReferences_MethodElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
m() {}
main() {
@@ -596,7 +596,7 @@ class A {
}
test_searchReferences_MethodMember() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A<T> {
T m() => null;
}
@@ -613,7 +613,7 @@ main(A<int> a) {
}
test_searchReferences_null_noUnitElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
m() {}
}
@@ -630,7 +630,7 @@ main(A a) {
}
test_searchReferences_ParameterElement_ofConstructor() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class C {
var f;
C({p}) : f = p + 1 {
@@ -660,7 +660,7 @@ main() {
}
test_searchReferences_ParameterElement_ofLocalFunction() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
main() {
foo({p}) {
p = 1;
@@ -685,7 +685,7 @@ main() {
}
test_searchReferences_ParameterElement_ofMethod() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class C {
foo({p}) {
p = 1;
@@ -712,7 +712,7 @@ main(C c) {
}
test_searchReferences_ParameterElement_ofTopLevelFunction() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
foo({p}) {
p = 1;
p += 2;
@@ -737,7 +737,7 @@ main() {
}
test_searchReferences_PrefixElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
import 'dart:async' as ppp;
main() {
ppp.Future a;
@@ -755,7 +755,7 @@ main() {
}
test_searchReferences_PropertyAccessorElement_getter() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
get ggg => null;
main() {
@@ -778,7 +778,7 @@ class A {
}
test_searchReferences_PropertyAccessorElement_setter() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {
set s(x) {}
main() {
@@ -803,7 +803,7 @@ class A {
library lib;
var V;
''');
- _indexTestUnit('''
+ await _indexTestUnit('''
import 'lib.dart' show V; // imp
import 'lib.dart' as pref;
main() {
@@ -833,7 +833,7 @@ main() {
}
test_searchReferences_TypeParameterElement() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A<T> {
main(T a, T b) {}
}
@@ -849,7 +849,7 @@ class A<T> {
}
test_searchSubtypes() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class T {}
class A extends T {} // A
class B = Object with T; // B
@@ -869,7 +869,7 @@ class C implements T {} // C
}
test_searchTopLevelDeclarations() async {
- _indexTestUnit('''
+ await _indexTestUnit('''
class A {} // A
class B = Object with A;
typedef C();
@@ -930,8 +930,8 @@ class NoMatchABCDE {}
isQualified: false, isResolved: false, length: length);
}
- void _indexTestUnit(String code) {
- resolveTestUnit(code);
+ Future<Null> _indexTestUnit(String code) async {
+ await resolveTestUnit(code);
index.indexUnit(testUnit);
}

Powered by Google App Engine
This is Rietveld 408576698