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

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

Issue 2466363003: Allow Platform.executable for JIT app snapshots. (Closed)
Patch Set: . Created 4 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
« no previous file with comments | « tests/standalone/io/file_lock_test.dart ('k') | tests/standalone/io/file_test.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) 2013, the Dart project authors. Please see the AUTHORS file 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 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 // OtherResources=file_read_stdio_script.dart
6
5 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
6 import 'package:path/path.dart'; 8 import 'package:path/path.dart';
7 import 'dart:io'; 9 import 'dart:io';
8 10
9 void openAndWriteScript(String script) { 11 void openAndWriteScript(String script) {
10 script = Platform.script.resolve(script).toFilePath(); 12 script = Platform.script.resolve(script).toFilePath();
11 var executable = Platform.executable; 13 var executable = Platform.executable;
12 var file = script; // Use script as file. 14 var file = script; // Use script as file.
13 Process.start("bash", ["-c", "$executable $script < $file"]).then((process) { 15 Process.start("bash", ["-c", "$executable $script < $file"]).then((process) {
14 process.exitCode 16 process.exitCode
15 .then((exitCode) { 17 .then((exitCode) {
16 Expect.equals(0, exitCode); 18 Expect.equals(0, exitCode);
17 }); 19 });
18 }); 20 });
19 } 21 }
20 22
21 void testReadStdio() { 23 void testReadStdio() {
22 openAndWriteScript("file_read_stdio_script.dart"); 24 openAndWriteScript("file_read_stdio_script.dart");
23 } 25 }
24 26
25 void main() { 27 void main() {
26 // Special unix devices do not exist on Windows. 28 // Special unix devices do not exist on Windows.
27 if (Platform.operatingSystem != 'windows') { 29 if (Platform.operatingSystem != 'windows') {
28 testReadStdio(); 30 testReadStdio();
29 } 31 }
30 } 32 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_lock_test.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698