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

Unified Diff: pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart

Issue 908463004: Convert refactoring tests to use 'await'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/refactoring/abstract_rename.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
diff --git a/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart b/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
index 8f11a334b246e104086eb3c70afa2058f0147f15..b748ea7c86e89029475198663c0fc5810e04f803 100644
--- a/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
+++ b/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
@@ -74,22 +74,19 @@ abstract class RefactoringTest extends AbstractSingleUnitTest {
/**
* Asserts that [refactoring] initial/final conditions status is OK.
*/
- Future assertRefactoringConditionsOK() {
- return refactoring.checkInitialConditions().then((status) {
- assertRefactoringStatusOK(status);
- return refactoring.checkFinalConditions().then((status) {
- assertRefactoringStatusOK(status);
- });
- });
+ Future assertRefactoringConditionsOK() async {
+ RefactoringStatus status = await refactoring.checkInitialConditions();
+ assertRefactoringStatusOK(status);
+ status = await refactoring.checkFinalConditions();
+ assertRefactoringStatusOK(status);
}
/**
* Asserts that [refactoring] final conditions status is OK.
*/
- Future assertRefactoringFinalConditionsOK() {
- return refactoring.checkFinalConditions().then((status) {
- assertRefactoringStatusOK(status);
- });
+ Future assertRefactoringFinalConditionsOK() async {
+ RefactoringStatus status = await refactoring.checkFinalConditions();
+ assertRefactoringStatusOK(status);
}
/**
@@ -129,13 +126,11 @@ abstract class RefactoringTest extends AbstractSingleUnitTest {
* Checks that all conditions of [refactoring] are OK and the result of
* applying the [Change] to [testUnit] is [expectedCode].
*/
- Future assertSuccessfulRefactoring(String expectedCode) {
- return assertRefactoringConditionsOK().then((_) {
- return refactoring.createChange().then((SourceChange change) {
- this.refactoringChange = change;
- assertTestChangeResult(expectedCode);
- });
- });
+ Future assertSuccessfulRefactoring(String expectedCode) async {
+ await assertRefactoringConditionsOK();
+ SourceChange change = await refactoring.createChange();
+ this.refactoringChange = change;
+ assertTestChangeResult(expectedCode);
}
/**
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/refactoring/abstract_rename.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698