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

Unified Diff: tests/lib/platform/isolate_test.dart

Issue 36883005: Add fields to platform library, implement them on runtime dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comments. Created 7 years, 2 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/lib/platform/isolate_test.dart
diff --git a/tests/lib/platform/isolate_test.dart b/tests/lib/platform/isolate_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..bfe001633d358e7d6f50732bf17032e866cc32ca
--- /dev/null
+++ b/tests/lib/platform/isolate_test.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2013, 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:platform" as platform;
+
+import "dart:isolate";
+import "package:unittest/unittest.dart";
+
+main() {
+ var sendPort = spawnFunction(f);
+ expect(sendPort.call("platform.executable"), completion(platform.executable));
+ if (platform.script != null) {
+ expect(sendPort.call("platform.script").then((s) => Uri.parse(s).path),
+ completion(endsWith('tests/lib/platform/isolate_test.dart')));
+ }
+ expect(sendPort.call("platform.packageRoot"),
+ completion(platform.packageRoot));
+ expect(sendPort.call("platform.executableArguments"),
+ completion(platform.executableArguments));
+}
+
+void f() {
+ int count = 0;
+ port.receive((msg, reply) {
+ if (msg == "platform.executable") {
+ reply.send(platform.executable);
+ }
+ if (msg == "platform.script") {
+ reply.send(platform.script);
+ }
+ if (msg == "platform.packageRoot") {
+ reply.send(platform.packageRoot);
+ }
+ if (msg == "platform.executableArguments") {
+ reply.send(platform.executableArguments);
+ }
+ count++;
+ if (count == 4) {
+ port.close();
+ }
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698