Chromium Code Reviews| 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(); |
| + }); |
| + }); |
| + }); |
| }); |
| }); |
| }); |