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

Side by Side Diff: tests/isolate/src/TestFramework.dart

Issue 8457005: convert isolates to use Future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated co19 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/isolate/src/Mixed2Test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("TestFramework"); 5 #library("TestFramework");
6 #import("dart:coreimpl"); 6 #import("dart:coreimpl");
7 7
8 8
9 typedef void AsynchronousTestFunction(TestExpectation check); 9 typedef void AsynchronousTestFunction(TestExpectation check);
10 10
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void succeeded() { 167 void succeeded() {
168 Expect.equals(0, pendingCallbacks); 168 Expect.equals(0, pendingCallbacks);
169 hasSucceeded = true; 169 hasSucceeded = true;
170 testCase.tearDown(); 170 testCase.tearDown();
171 } 171 }
172 172
173 void failed() { 173 void failed() {
174 testCase.tearDown(); 174 testCase.tearDown();
175 } 175 }
176 176
177 Promise completes(Promise promise) { 177 Promise completes(var promise) {
178 if (!(promise is Promise || promise is Future)) {
179 // TODO(mattsh) - remove this hack once we finish conversion of
180 // Promise to Future
181 throw "must pass Promise or Future to TestFramework.completes";
182 }
183
178 Promise result = new TestPromise(this); 184 Promise result = new TestPromise(this);
179 promise.then((value) { result.complete(value); }); 185 promise.then((value) { result.complete(value); });
180 return result; 186 return result;
181 } 187 }
182 188
183 Promise completesWithValue(Promise promise, var expected) { 189 Promise completesWithValue(Promise promise, var expected) {
184 Promise result = new TestPromise(this); 190 Promise result = new TestPromise(this);
185 promise.then((value) { 191 promise.then((value) {
186 Expect.equals(expected, value); 192 Expect.equals(expected, value);
187 result.complete(value); 193 result.complete(value);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 289
284 void addCompleteHandler(void completeHandler(T result)) { 290 void addCompleteHandler(void completeHandler(T result)) {
285 super.addCompleteHandler(expect.runs1((T result) { 291 super.addCompleteHandler(expect.runs1((T result) {
286 completeHandler(result); 292 completeHandler(result);
287 })); 293 }));
288 } 294 }
289 295
290 final TestExpectation expect; 296 final TestExpectation expect;
291 297
292 } 298 }
OLDNEW
« no previous file with comments | « tests/isolate/src/Mixed2Test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698