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

Side by Side Diff: tests/standalone/io/platform_test.dart

Issue 37033002: dart:io | Remove uses of Options class from standalone tests. Mark Options deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove commented lines from standalone.status. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/https_unauthorized_test.dart ('k') | tests/standalone/io/print_env.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:async"; 5 import "dart:async";
6 import "dart:io"; 6 import "dart:io";
7 import "dart:isolate"; 7 import "dart:isolate";
8 8
9 import "package:async_helper/async_helper.dart"; 9 import "package:async_helper/async_helper.dart";
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 if (msg == "Platform.script") { 42 if (msg == "Platform.script") {
43 reply.send(Platform.script); 43 reply.send(Platform.script);
44 } 44 }
45 if (msg == "Platform.packageRoot") { 45 if (msg == "Platform.packageRoot") {
46 reply.send(Platform.packageRoot); 46 reply.send(Platform.packageRoot);
47 } 47 }
48 if (msg == "Platform.executableArguments") { 48 if (msg == "Platform.executableArguments") {
49 reply.send(Platform.executableArguments); 49 reply.send(Platform.executableArguments);
50 } 50 }
51 if (msg == "new Options().executable") {
52 reply.send(new Options().executable);
53 }
54 if (msg == "new Options().script") {
55 reply.send(new Options().script);
56 }
57 if (msg == "close") { 51 if (msg == "close") {
58 reply.send("closed"); 52 reply.send("closed");
59 port.close(); 53 port.close();
60 } 54 }
61 }); 55 });
62 } 56 }
63 57
64 testIsolate() { 58 testIsolate() {
65 asyncStart(); 59 asyncStart();
66 var sendPort = spawnFunction(f); 60 var sendPort = spawnFunction(f);
67 Future.wait([sendPort.call("Platform.executable"), 61 Future.wait([sendPort.call("Platform.executable"),
68 sendPort.call("Platform.script"), 62 sendPort.call("Platform.script"),
69 sendPort.call("Platform.packageRoot"), 63 sendPort.call("Platform.packageRoot"),
70 sendPort.call("Platform.executableArguments"), 64 sendPort.call("Platform.executableArguments")])
71 sendPort.call("new Options().executable"),
72 sendPort.call("new Options().script")])
73 .then((results) { 65 .then((results) {
74 Expect.equals(Platform.executable, results[0]); 66 Expect.equals(Platform.executable, results[0]);
75 Expect.equals(Platform.executable, results[4]);
76 Uri uri = Uri.parse(results[1]); 67 Uri uri = Uri.parse(results[1]);
77 Expect.equals(uri, Uri.parse(results[5]));
78 Expect.equals("file", uri.scheme); 68 Expect.equals("file", uri.scheme);
79 Expect.isTrue(uri.path.endsWith('tests/standalone/io/platform_test.dart')); 69 Expect.isTrue(uri.path.endsWith('tests/standalone/io/platform_test.dart'));
80 Expect.equals(Platform.packageRoot, results[2]); 70 Expect.equals(Platform.packageRoot, results[2]);
81 Expect.listEquals(Platform.executableArguments, results[3]); 71 Expect.listEquals(Platform.executableArguments, results[3]);
82 sendPort.call("close").then((_) => asyncEnd()); 72 sendPort.call("close").then((_) => asyncEnd());
83 }); 73 });
84 } 74 }
85 75
86 main() { 76 main() {
87 test(); 77 test();
88 testIsolate(); 78 testIsolate();
89 } 79 }
OLDNEW
« no previous file with comments | « tests/standalone/io/https_unauthorized_test.dart ('k') | tests/standalone/io/print_env.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698