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

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

Issue 23886004: Update dart:io tests to use asyncStart/asyncEnd (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 3 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
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:io';
6
7 import "package:async_helper/async_helper.dart";
5 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
6 import 'dart:io';
7 import 'dart:isolate';
8 9
9 main() { 10 main() {
10 var port = new ReceivePort(); 11 asyncStart();
11 var executable = new File(Platform.executable).fullPathSync(); 12 var executable = new File(Platform.executable).fullPathSync();
12 var tempDir = new Directory('').createTempSync(); 13 var tempDir = new Directory('').createTempSync();
13 var nonAsciiDir = new Directory('${tempDir.path}/æøå'); 14 var nonAsciiDir = new Directory('${tempDir.path}/æøå');
14 nonAsciiDir.createSync(); 15 nonAsciiDir.createSync();
15 var nonAsciiFile = new File('${nonAsciiDir.path}/æøå.dart'); 16 var nonAsciiFile = new File('${nonAsciiDir.path}/æøå.dart');
16 nonAsciiFile.writeAsStringSync( 17 nonAsciiFile.writeAsStringSync(
17 """ 18 """
18 import 'dart:io'; 19 import 'dart:io';
19 20
20 main() { 21 main() {
21 if ('æøå' != new File('æøå.txt').readAsStringSync()) { 22 if ('æøå' != new File('æøå.txt').readAsStringSync()) {
22 throw new StateError("not equal"); 23 throw new StateError("not equal");
23 } 24 }
24 } 25 }
25 """); 26 """);
26 var nonAsciiTxtFile = new File('${nonAsciiDir.path}/æøå.txt'); 27 var nonAsciiTxtFile = new File('${nonAsciiDir.path}/æøå.txt');
27 nonAsciiTxtFile.writeAsStringSync('æøå'); 28 nonAsciiTxtFile.writeAsStringSync('æøå');
28 var script = nonAsciiFile.path; 29 var script = nonAsciiFile.path;
29 Process.run(executable, [script], workingDirectory: nonAsciiDir.path) 30 Process.run(executable, [script], workingDirectory: nonAsciiDir.path)
30 .then((result) { 31 .then((result) {
31 Expect.equals(0, result.exitCode); 32 Expect.equals(0, result.exitCode);
32 tempDir.deleteSync(recursive: true); 33 tempDir.deleteSync(recursive: true);
33 port.close(); 34 asyncEnd();
34 }); 35 });
35 } 36 }
OLDNEW
« no previous file with comments | « tests/standalone/io/process_environment_test.dart ('k') | tests/standalone/io/process_pid_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698