Skip to content

Commit

Permalink
Convert more tests to use the new driver
Browse files Browse the repository at this point in the history
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2939803002 .
  • Loading branch information
bwilkerson committed Jun 13, 2017
1 parent 0912f3c commit 4da8380
Show file tree
Hide file tree
Showing 13 changed files with 329 additions and 1,201 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ class AnalysisNotificationImplementedTest extends AbstractAnalysisTest {
List<ImplementedClass> implementedClasses;
List<ImplementedMember> implementedMembers;

@override
bool get enableNewAnalysisDriver => false;

/**
* Validates that there is an [ImplementedClass] at the offset of [search].
*
Expand Down Expand Up @@ -128,7 +125,10 @@ class AnalysisNotificationImplementedTest extends AbstractAnalysisTest {
addAnalysisSubscription(AnalysisService.IMPLEMENTED, testFile);
}

@failingTest
test_afterAnalysis() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {}
class B extends A {}
Expand All @@ -138,7 +138,10 @@ class B extends A {}
assertHasImplementedClass('A {');
}

@failingTest
test_afterIncrementalResolution() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
subscribeForImplemented();
addTestFile('''
class A {}
Expand All @@ -157,7 +160,10 @@ class B extends A {}
assertHasImplementedClass('A {');
}

@failingTest
test_class_extended() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {}
class B extends A {}
Expand All @@ -166,7 +172,10 @@ class B extends A {}
assertHasImplementedClass('A {');
}

@failingTest
test_class_implemented() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {}
class B implements A {}
Expand All @@ -175,7 +184,10 @@ class B implements A {}
assertHasImplementedClass('A {');
}

@failingTest
test_class_mixed() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {}
class B = Object with A;
Expand All @@ -184,7 +196,10 @@ class B = Object with A;
assertHasImplementedClass('A {');
}

@failingTest
test_field_withField() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
int f; // A
Expand All @@ -197,7 +212,10 @@ class B extends A {
assertHasImplementedMember('f; // A');
}

@failingTest
test_field_withGetter() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
int f; // A
Expand All @@ -210,7 +228,10 @@ class B extends A {
assertHasImplementedMember('f; // A');
}

@failingTest
test_field_withSetter() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
int f; // A
Expand All @@ -223,7 +244,10 @@ class B extends A {
assertHasImplementedMember('f; // A');
}

@failingTest
test_getter_withField() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
get f => null; // A
Expand All @@ -236,7 +260,10 @@ class B extends A {
assertHasImplementedMember('f => null; // A');
}

@failingTest
test_getter_withGetter() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
get f => null; // A
Expand All @@ -249,7 +276,10 @@ class B extends A {
assertHasImplementedMember('f => null; // A');
}

@failingTest
test_method_withMethod() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
m() {} // A
Expand All @@ -263,7 +293,10 @@ class B extends A {
assertNoImplementedMember('m() {} // B');
}

@failingTest
test_method_withMethod_indirectSubclass() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
m() {} // A
Expand All @@ -278,7 +311,10 @@ class C extends A {
assertHasImplementedMember('m() {} // A');
}

@failingTest
test_method_withMethod_private_differentLib() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addFile(
'$testFolder/lib.dart',
r'''
Expand All @@ -296,7 +332,10 @@ class A {
assertNoImplementedMember('_m() {} // A');
}

@failingTest
test_method_withMethod_private_sameLibrary() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
_m() {} // A
Expand All @@ -310,7 +349,10 @@ class B extends A {
assertNoImplementedMember('_m() {} // B');
}

@failingTest
test_method_withMethod_wasAbstract() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
abstract class A {
m(); // A
Expand All @@ -323,7 +365,10 @@ class B extends A {
assertHasImplementedMember('m(); // A');
}

@failingTest
test_setter_withField() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
set f(_) {} // A
Expand All @@ -336,7 +381,10 @@ class B extends A {
assertHasImplementedMember('f(_) {} // A');
}

@failingTest
test_setter_withSetter() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
set f(_) {} // A
Expand All @@ -349,7 +397,10 @@ class B extends A {
assertHasImplementedMember('f(_) {} // A');
}

@failingTest
test_static_field_instanceStatic() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
int F = 0;
Expand All @@ -362,7 +413,10 @@ class B extends A {
assertNoImplementedMember('F = 0');
}

@failingTest
test_static_field_staticInstance() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
static int F = 0;
Expand All @@ -375,7 +429,10 @@ class B extends A {
assertNoImplementedMember('F = 0');
}

@failingTest
test_static_field_staticStatic() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
static int F = 0;
Expand All @@ -388,7 +445,10 @@ class B extends A {
assertNoImplementedMember('F = 0');
}

@failingTest
test_static_method_instanceStatic() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
int m() => 0;
Expand All @@ -401,7 +461,10 @@ class B extends A {
assertNoImplementedMember('m() => 0');
}

@failingTest
test_static_method_staticInstance() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
static int m() => 0;
Expand All @@ -414,7 +477,10 @@ class B extends A {
assertNoImplementedMember('m() => 0');
}

@failingTest
test_static_method_staticStatic() async {
// See https://github.com/dart-lang/sdk/issues/29113
fail('The analysis.implemented notification is not implemented.');
addTestFile('''
class A {
static int m() => 0;
Expand Down
14 changes: 7 additions & 7 deletions pkg/analysis_server/test/domain_analysis_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -649,13 +649,13 @@ class AnalysisTestHelper {
class SetSubscriptionsTest extends AbstractAnalysisTest {
Map<String, List<HighlightRegion>> filesHighlights = {};

@override
bool get enableNewAnalysisDriver => false;
Completer _resultsAvailable = new Completer();

void processNotification(Notification notification) {
if (notification.event == ANALYSIS_HIGHLIGHTS) {
var params = new AnalysisHighlightsParams.fromNotification(notification);
filesHighlights[params.file] = params.regions;
_resultsAvailable.complete(null);
}
}

Expand All @@ -667,7 +667,7 @@ class SetSubscriptionsTest extends AbstractAnalysisTest {
expect(filesHighlights[testFile], isNull);
// subscribe
addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile);
await server.onAnalysisComplete;
await _resultsAvailable.future;
// there are results
expect(filesHighlights[testFile], isNotEmpty);
}
Expand Down Expand Up @@ -709,7 +709,7 @@ main() {
expect(filesHighlights[pkgFile], isNull);
// subscribe
addAnalysisSubscription(AnalysisService.HIGHLIGHTS, pkgFile);
await server.onAnalysisComplete;
await _resultsAvailable.future;
// there are results
expect(filesHighlights[pkgFile], isNotEmpty);
}
Expand Down Expand Up @@ -750,7 +750,7 @@ main() {
expect(filesHighlights[pkgFileA], isNull);
// subscribe
addAnalysisSubscription(AnalysisService.HIGHLIGHTS, pkgFileA);
await server.onAnalysisComplete;
await _resultsAvailable.future;
// there are results
expect(filesHighlights[pkgFileA], isNotEmpty);
}
Expand All @@ -774,7 +774,7 @@ class A {}
server.setPriorityFiles('0', [pkgFile]);
// subscribe
addAnalysisSubscription(AnalysisService.HIGHLIGHTS, pkgFile);
await server.onAnalysisComplete;
await _resultsAvailable.future;
// there are results
expect(filesHighlights[pkgFile], isNotEmpty);
}
Expand All @@ -788,7 +788,7 @@ class A {}
expect(filesHighlights[file], isNull);
// subscribe
addAnalysisSubscription(AnalysisService.HIGHLIGHTS, file);
await server.onAnalysisComplete;
await _resultsAvailable.future;
// there are results
expect(filesHighlights[file], isNotEmpty);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/analysis_server/test/integration/coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ server calls. This file is validated by `coverage_test.dart`.
## analysis domain
- [x] analysis.getErrors
- [x] analysis.getHover
- [x] analysis.getReachableSources (failing - see #329311)
- [x] analysis.getReachableSources (failing - see #29311)
- [x] analysis.getLibraryDependencies (failing - see #29310)
- [x] analysis.getNavigation (failing - see #28799)
- [x] analysis.reanalyze
Expand Down
5 changes: 2 additions & 3 deletions pkg/analysis_server/test/services/correction/status_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ main() {

@reflectiveTest
class RefactoringLocationTest extends AbstractSingleUnitTest {
@override
bool get enableNewAnalysisDriver => false;

test_createLocation_forElement() async {
await resolveTestUnit('class MyClass {}');
Element element = findElement('MyClass');
Expand All @@ -39,7 +36,9 @@ class RefactoringLocationTest extends AbstractSingleUnitTest {
expect(location.startColumn, 7);
}

@failingTest
test_createLocation_forMatch() async {
// The class SearchMatchImpl has not been converted to use the new driver.
await resolveTestUnit('class MyClass {}');
Element element = findElement('MyClass');
SourceRange sourceRange = range.elementName(element);
Expand Down
7 changes: 4 additions & 3 deletions pkg/analysis_server/test/services/correction/util_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ main() {

@reflectiveTest
class UtilTest extends AbstractSingleUnitTest {
@override
bool get enableNewAnalysisDriver => false;

test_addLibraryImports_dart_hasImports_between() async {
await resolveTestUnit('''
import 'dart:async';
Expand Down Expand Up @@ -195,6 +192,7 @@ class A {}
}

test_addLibraryImports_package_hasDart_hasPackages_insertAfter() async {
addPackageSource('aaa', 'aaa.dart', '');
await resolveTestUnit('''
import 'dart:async';
Expand All @@ -212,6 +210,7 @@ import 'package:bbb/bbb.dart';
}

test_addLibraryImports_package_hasDart_hasPackages_insertBefore() async {
addPackageSource('bbb', 'bbb.dart', '');
await resolveTestUnit('''
import 'dart:async';
Expand All @@ -229,6 +228,8 @@ import 'package:bbb/bbb.dart';
}

test_addLibraryImports_package_hasImports_between() async {
addPackageSource('aaa', 'aaa.dart', '');
addPackageSource('ddd', 'ddd.dart', '');
await resolveTestUnit('''
import 'package:aaa/aaa.dart';
import 'package:ddd/ddd.dart';
Expand Down
Loading

0 comments on commit 4da8380

Please sign in to comment.