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

Unified Diff: tests/isolate/src/TestFramework.dart

Issue 8478014: convert isolate TestFramework from Promise Future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: change TestFramework to Future Created 9 years, 1 month 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 | « tests/isolate/src/PromiseBasedTest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/src/TestFramework.dart
diff --git a/tests/isolate/src/TestFramework.dart b/tests/isolate/src/TestFramework.dart
index 97162ba279790417dcf6750567bf4728d8169d2a..67e669578601d39829e6c8ea72ff8142e5733fc6 100644
--- a/tests/isolate/src/TestFramework.dart
+++ b/tests/isolate/src/TestFramework.dart
@@ -174,16 +174,17 @@ class TestExpectation {
testCase.tearDown();
}
- Promise completes(var promise) {
- if (!(promise is Promise || promise is Future)) {
+ Future completes(var future) {
+ if (!(future is Promise || future is Future)) {
// TODO(mattsh) - remove this hack once we finish conversion of
// Promise to Future
throw "must pass Promise or Future to TestFramework.completes";
}
-
- Promise result = new TestPromise(this);
- promise.then((value) { result.complete(value); });
- return result;
+ Completer completer = new Completer();
+ future.then(runs1((value) {
+ completer.complete(value);
+ }));
+ return completer.future;
}
Promise completesWithValue(Promise promise, var expected) {
« no previous file with comments | « tests/isolate/src/PromiseBasedTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698