Chromium Code Reviews| Index: tests/isolate/src/APIv2_spawnUriBrowserNegativeTest.dart |
| =================================================================== |
| --- tests/isolate/src/APIv2_spawnUriBrowserNegativeTest.dart (revision 0) |
| +++ tests/isolate/src/APIv2_spawnUriBrowserNegativeTest.dart (revision 0) |
| @@ -0,0 +1,23 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// Negative test to make sure that we are reaching all assertions. |
| +#library('spawn_tests'); |
| +#import("../../../client/testing/unittest/unittest.dart"); |
| +#import("dart:dom"); // import added so test.dart can treat this as a webtest. |
| + |
| +main() { |
| + asyncTest("message - reply chain", 1, () { |
|
Siggi Cherem (dart-lang)
2012/02/14 01:16:46
let's indicate in the message that this is for spa
eub
2012/02/15 19:58:22
How's this?
|
| + ReceivePort port = new ReceivePort(); |
| + port.receive((msg, _) { |
| + expect(msg).equals("re: hello"); // should be hi, not hello |
| + port.close(); |
| + callbackDone(); |
| + }); |
| + |
| + // TODO(eub): make this work for non-JS targets. |
| + Isolate2 c = new Isolate2.fromUri("./APIv2_spawnUriChildIsolate.js"); |
| + c.sendPort.send("hi", port.toSendPort()); |
| + }); |
| +} |