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

Unified Diff: tests/html/isolates_test.dart

Issue 10412015: aChange all asyncTest/callbackDone style tests to use the new expectAsync/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
Index: tests/html/isolates_test.dart
===================================================================
--- tests/html/isolates_test.dart (revision 7823)
+++ tests/html/isolates_test.dart (working copy)
@@ -33,20 +33,28 @@
main() {
useHtmlConfiguration();
- asyncTest('IsolateSpawn', 1, () {
+ test('IsolateSpawn', () {
+ var callback = expectAsync0((){});
Siggi Cherem (dart-lang) 2012/05/21 22:20:47 you can probably get this to work with expectAsync
gram 2012/05/22 17:36:36 Done.
new PingPongIsolate().spawn().then((isolate.SendPort port) {
- callbackDone();
+ callback();
});
});
- asyncTest('NonDOMIsolates', 1, () {
+ test('NonDOMIsolates', () {
+ var callback = expectAsync0((){});
new PingPongIsolate().spawn().then((isolate.SendPort port) {
- final msg1 = 'foo';
- final msg2 = 'bar';
- port.call(msg1).then((response) {
- Expect.equals(PingPongIsolate.responseFor(msg1), response);
- port.call(msg2).then((response) {
- Expect.equals(PingPongIsolate.responseFor(msg2), response);
- callbackDone();
+ guardAsync(() {
+ final msg1 = 'foo';
+ final msg2 = 'bar';
+ port.call(msg1).then((response) {
+ guardAsync(() {
+ Expect.equals(PingPongIsolate.responseFor(msg1), response);
+ port.call(msg2).then((response) {
+ guardAsync(() {
+ Expect.equals(PingPongIsolate.responseFor(msg2), response);
+ callback();
+ });
+ });
+ });
});
});
});

Powered by Google App Engine
This is Rietveld 408576698