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

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: fix typos 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..1122e96e8f84e98daae013626c0d624199d0b361 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) {
@@ -282,7 +283,7 @@ class AsynchronousTestCase extends TestCase {
}
-
+// TODO(mattsh) - remove this once we have migrated the rpc system
class TestPromise<T> extends PromiseImpl<T> {
TestPromise(this.expect) : super();
« 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