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

Unified Diff: pkg/analysis_server/test/analysis_notification_occurrences_test.dart

Issue 406583002: Use futures uniformly rather than a mix of futures and CPS in tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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/analysis_notification_occurrences_test.dart
diff --git a/pkg/analysis_server/test/analysis_notification_occurrences_test.dart b/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
index 8f65214ddac96a5c50d7a2c6328944ac7aace627..a1d48a0d7e47db0736bf81ca2005a0d7a0c4a6c0 100644
--- a/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
+++ b/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
@@ -82,11 +82,9 @@ class AnalysisNotificationOccurrencesTest extends AbstractAnalysisTest {
}
}
- Future prepareOccurrences(then()) {
+ Future prepareOccurrences() {
addAnalysisSubscription(AnalysisService.OCCURRENCES, testFile);
- return waitForTasksFinished().then((_) {
- then();
- });
+ return waitForTasksFinished();
}
void processNotification(Notification notification) {
@@ -117,7 +115,7 @@ main() {
}
''');
return waitForTasksFinished().then((_) {
- return prepareOccurrences(() {
+ return prepareOccurrences().then((_) {
assertHasRegion('vvv =');
expect(testOccurences.element.kind, ElementKind.LOCAL_VARIABLE);
expect(testOccurences.element.name, 'vvv');
@@ -136,7 +134,7 @@ main() {
}
int VVV = 4;
''');
- return prepareOccurrences(() {
+ return prepareOccurrences().then((_) {
assertHasRegion('int a');
expect(testOccurences.element.kind, ElementKind.CLASS);
expect(testOccurences.element.name, 'int');
@@ -158,7 +156,7 @@ class A {
}
}
''');
- return prepareOccurrences(() {
+ return prepareOccurrences().then((_) {
assertHasRegion('fff;');
expect(testOccurences.element.kind, ElementKind.FIELD);
assertHasOffset('fff); // constructor');
@@ -175,7 +173,7 @@ main() {
print(vvv);
}
''');
- return prepareOccurrences(() {
+ return prepareOccurrences().then((_) {
assertHasRegion('vvv =');
expect(testOccurences.element.kind, ElementKind.LOCAL_VARIABLE);
expect(testOccurences.element.name, 'vvv');
@@ -197,7 +195,7 @@ main() {
b.fff = 2;
}
''');
- return prepareOccurrences(() {
+ return prepareOccurrences().then((_) {
assertHasRegion('fff;');
expect(testOccurences.element.kind, ElementKind.FIELD);
assertHasOffset('fff = 1;');
@@ -217,7 +215,7 @@ main() {
b.mmm(); // b
}
''');
- return prepareOccurrences(() {
+ return prepareOccurrences().then((_) {
assertHasRegion('mmm() {}');
expect(testOccurences.element.kind, ElementKind.METHOD);
assertHasOffset('mmm(); // a');
@@ -233,7 +231,7 @@ main() {
print(VVV);
}
''');
- return prepareOccurrences(() {
+ return prepareOccurrences().then((_) {
assertHasRegion('VVV = 1;');
expect(testOccurences.element.kind, ElementKind.TOP_LEVEL_VARIABLE);
assertHasOffset('VVV = 2;');

Powered by Google App Engine
This is Rietveld 408576698