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

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

Issue 9401030: remove promise from corelib (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 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 | « tests/isolate/src/PromiseBasedTest.dart ('k') | tests/stub-generator/src/MintMakerFullyIsolatedTest.dart » ('j') | 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 405a1e8cdee52a10d0d5ec093260a5b53d920d91..e15cda2052eb8dc6fc2850b619a8dc24dd8c8486 100644
--- a/tests/isolate/src/TestFramework.dart
+++ b/tests/isolate/src/TestFramework.dart
@@ -173,12 +173,7 @@ class TestExpectation {
testCase.tearDown();
}
- 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";
- }
+ Future completes(Future future) {
Completer completer = new Completer();
future.then(runs1((value) {
completer.complete(value);
@@ -186,15 +181,6 @@ class TestExpectation {
return completer.future;
}
- Promise completesWithValue(Promise promise, var expected) {
- Promise promiseResult = new TestPromise(this);
- promise.then((value) {
- Expect.equals(expected, value);
- promiseResult.complete(value);
- });
- return promiseResult;
- }
-
Function runs0(Function fn) {
bool ran = false; // We only check that the function is executed once.
pendingCallbacks++;
@@ -286,18 +272,3 @@ class AsynchronousTestCase extends TestCase {
static ReceivePort keepalive = null;
}
-
-// TODO(mattsh) - remove this once we have migrated the rpc system
-class TestPromise<T> extends PromiseImpl<T> {
-
- TestPromise(this.expect) : super();
-
- void addCompleteHandler(void completeHandler(T result)) {
- super.addCompleteHandler(expect.runs1((T result) {
- completeHandler(result);
- }));
- }
-
- final TestExpectation expect;
-
-}
« no previous file with comments | « tests/isolate/src/PromiseBasedTest.dart ('k') | tests/stub-generator/src/MintMakerFullyIsolatedTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698