| Index: pkg/analysis_server/test/analysis/notification_implemented_test.dart
|
| diff --git a/pkg/analysis_server/test/analysis/notification_implemented_test.dart b/pkg/analysis_server/test/analysis/notification_implemented_test.dart
|
| index a26ff5603471288482c86983da1776e425b4796a..6465c3d89a62de7b4b87076a92ffb596e9e73dce 100644
|
| --- a/pkg/analysis_server/test/analysis/notification_implemented_test.dart
|
| +++ b/pkg/analysis_server/test/analysis/notification_implemented_test.dart
|
| @@ -90,16 +90,12 @@ class AnalysisNotificationImplementedTest extends AbstractAnalysisTest {
|
| return createLocalMemoryIndex();
|
| }
|
|
|
| + /**
|
| + * Subscribe for `IMPLEMENTED` and wait to the notification.
|
| + */
|
| Future prepareImplementedElements() {
|
| - addAnalysisSubscription(AnalysisService.IMPLEMENTED, testFile);
|
| - Future waitForNotification(int times) {
|
| - if (times == 0 || implementedClasses != null) {
|
| - return new Future.value();
|
| - }
|
| - return new Future.delayed(
|
| - Duration.ZERO, () => waitForNotification(times - 1));
|
| - }
|
| - return waitForNotification(100);
|
| + subscribeForImplemented();
|
| + return waitForImplementedElements();
|
| }
|
|
|
| void processNotification(Notification notification) {
|
| @@ -117,6 +113,10 @@ class AnalysisNotificationImplementedTest extends AbstractAnalysisTest {
|
| createProject();
|
| }
|
|
|
| + void subscribeForImplemented() {
|
| + addAnalysisSubscription(AnalysisService.IMPLEMENTED, testFile);
|
| + }
|
| +
|
| test_afterAnalysis() async {
|
| addTestFile('''
|
| class A {}
|
| @@ -127,6 +127,26 @@ class B extends A {}
|
| assertHasImplementedClass('A {');
|
| }
|
|
|
| + test_afterIncrementalResolution() async {
|
| + subscribeForImplemented();
|
| + addTestFile('''
|
| +class A {}
|
| +class B extends A {}
|
| +''');
|
| + await prepareImplementedElements();
|
| + assertHasImplementedClass('A {');
|
| + // add a space
|
| + implementedClasses = null;
|
| + server.updateContent('1', {
|
| + testFile: new AddContentOverlay('''
|
| +class A {}
|
| +class B extends A {}
|
| +''')
|
| + });
|
| + await waitForImplementedElements();
|
| + assertHasImplementedClass('A {');
|
| + }
|
| +
|
| test_class_extended() async {
|
| addTestFile('''
|
| class A {}
|
| @@ -286,4 +306,15 @@ class B extends A {
|
| await prepareImplementedElements();
|
| assertHasImplementedMember('f(_) {} // A');
|
| }
|
| +
|
| + Future waitForImplementedElements() {
|
| + Future waitForNotification(int times) {
|
| + if (times == 0 || implementedClasses != null) {
|
| + return new Future.value();
|
| + }
|
| + return new Future.delayed(
|
| + Duration.ZERO, () => waitForNotification(times - 1));
|
| + }
|
| + return waitForNotification(100);
|
| + }
|
| }
|
|
|