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

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

Issue 9386027: First exercise of spawnUri. Enabling the test needs issue 1666, but hand-running the test (copyi... (Closed) Base URL: http://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
Index: tests/isolate/src/APIv2_spawnUriBrowserTest.dart
===================================================================
--- tests/isolate/src/APIv2_spawnUriBrowserTest.dart (revision 0)
+++ tests/isolate/src/APIv2_spawnUriBrowserTest.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.
+
+// example of spawning an isolate from a URI
+#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, () {
+ ReceivePort port = new ReceivePort();
+ port.receive((msg, _) {
+ expect(msg).equals("re: hi");
+ 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());
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698