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

Side by Side Diff: tests/standalone/io/directory_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 12
12 // On MacOS you get the decomposed utf8 form of file and directory 13 // On MacOS you get the decomposed utf8 form of file and directory
13 // names from the system. Therefore, we have to check for both here. 14 // names from the system. Therefore, we have to check for both here.
14 var precomposed = 'æøå'; 15 var precomposed = 'æøå';
15 var decomposed = new String.fromCharCodes([47, 230, 248, 97, 778]); 16 var decomposed = new String.fromCharCodes([47, 230, 248, 97, 778]);
16 17
17 new Directory('').createTemp().then((tempDir) { 18 new Directory('').createTemp().then((tempDir) {
18 var nonAsciiDir = new Directory("${tempDir.path}/æøå"); 19 var nonAsciiDir = new Directory("${tempDir.path}/æøå");
19 nonAsciiDir.exists().then((e) { 20 nonAsciiDir.exists().then((e) {
20 Expect.isFalse(e); 21 Expect.isFalse(e);
21 nonAsciiDir.create().then((_) { 22 nonAsciiDir.create().then((_) {
22 nonAsciiDir.exists().then((e) { 23 nonAsciiDir.exists().then((e) {
23 Expect.isTrue(e); 24 Expect.isTrue(e);
24 new Directory("${tempDir.path}/æøå").createTemp().then((temp) { 25 new Directory("${tempDir.path}/æøå").createTemp().then((temp) {
25 Expect.isTrue(temp.path.contains(precomposed) || 26 Expect.isTrue(temp.path.contains(precomposed) ||
26 temp.path.contains(decomposed)); 27 temp.path.contains(decomposed));
27 temp.delete().then((_) { 28 temp.delete().then((_) {
28 tempDir.delete(recursive: true).then((_) { 29 tempDir.delete(recursive: true).then((_) {
29 Expect.isFalse(temp.existsSync()); 30 Expect.isFalse(temp.existsSync());
30 Expect.isFalse(nonAsciiDir.existsSync()); 31 Expect.isFalse(nonAsciiDir.existsSync());
31 port.close(); 32 asyncEnd();
32 }); 33 });
33 }); 34 });
34 }); 35 });
35 }); 36 });
36 }); 37 });
37 }); 38 });
38 }); 39 });
39 } 40 }
OLDNEW
« no previous file with comments | « tests/standalone/io/directory_list_pause_test.dart ('k') | tests/standalone/io/directory_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698