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

Unified Diff: runtime/tests/vm/dart/data_uri_spawn_test.dart

Issue 1028453002: Support percent encoded data URIs in the standalone embedder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add negative tests, make multitest understand data uris, fix test in checked mode Created 5 years, 9 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: runtime/tests/vm/dart/data_uri_spawn_test.dart
diff --git a/runtime/tests/vm/dart/data_uri_spawn_test.dart b/runtime/tests/vm/dart/data_uri_spawn_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3ee0370ea1821a52f8a6d209dff4cc6eb4258988
--- /dev/null
+++ b/runtime/tests/vm/dart/data_uri_spawn_test.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2015, 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.
+
+import "dart:isolate";
+import "package:unittest/unittest.dart";
+
+Uri toDartDataUri(String source) {
+ return Uri.parse("data:application/dart;charset=utf-8,"
+ "${Uri.encodeComponent(source)}");
+}
+
+main() {
+ test('Simple response', () {
+ String source = """
+import "dart:isolate";
+main(List args, SendPort replyPort) {
+ print('Child running');
+ replyPort.send(42);
+}
+""";
+
+ RawReceivePort receivePort;
+ receivePort = new RawReceivePort(expectAsync((int message) {
+ expect(message, equals(42));
+ receivePort.close();
+ }));
+ Isolate.spawnUri(toDartDataUri(source), [], receivePort.sendPort);
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698