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

Side by Side 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: Address all comments Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "dart:platform" as platform;
6
7 import "dart:isolate";
8 import "package:unittest/unittest.dart";
9
10 main() {
11 var sendPort = spawnFunction(f);
12 expect(sendPort.call("platform.executable"), completion(platform.executable));
13 if (platform.script != null) {
14 expect(sendPort.call("platform.script").then((s) => s.path),
15 completion(endsWith('tests/lib/platform/isolate_test.dart')));
16 }
17 expect(sendPort.call("platform.packageRoot"),
18 completion(platform.packageRoot));
19 expect(sendPort.call("platform.executableArguments"),
20 completion(platform.executableArguments));
21 }
22
23 void f() {
24 int count = 0;
25 port.receive((msg, reply) {
26 if (msg == "platform.executable") {
27 reply.send(platform.executable);
28 }
29 if (msg == "platform.script") {
30 reply.send(platform.script);
31 }
32 if (msg == "platform.packageRoot") {
33 reply.send(platform.packageRoot);
34 }
35 if (msg == "platform.executableArguments") {
36 reply.send(platform.executableArguments);
37 }
38 count++;
39 if (count == 4) {
40 port.close();
41 }
42 });
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698