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

Side by Side Diff: tests/standalone/io/file_stat_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) 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 // Dart test program for testing dart:io FileSystemEntity.Stat(). 5 // Dart test program for testing dart:io FileSystemEntity.Stat().
6 6
7 import 'dart:async';
8 import 'dart:io';
9
10 import "package:async_helper/async_helper.dart";
7 import "package:expect/expect.dart"; 11 import "package:expect/expect.dart";
8 import "package:path/path.dart"; 12 import "package:path/path.dart";
9 import 'dart:async';
10 import 'dart:io';
11 import 'dart:isolate';
12 13
13 void testStat() { 14 void testStat() {
14 Directory directory = new Directory("").createTempSync(); 15 Directory directory = new Directory("").createTempSync();
15 File file = new File(join(directory.path, "file")); 16 File file = new File(join(directory.path, "file"));
16 Expect.throws(file.statSync); 17 Expect.throws(file.statSync);
17 Expect.throws(() => FileStat.statSync(file.path)); 18 Expect.throws(() => FileStat.statSync(file.path));
18 file.writeAsStringSync("Dart IO library test of FileStat"); 19 file.writeAsStringSync("Dart IO library test of FileStat");
19 new Timer(const Duration(seconds: 2), () { 20 new Timer(const Duration(seconds: 2), () {
20 file.readAsStringSync(); 21 file.readAsStringSync();
21 directory.listSync(); 22 directory.listSync();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 linkStat.changed.compareTo(linkStat.accessed) < 0); 113 linkStat.changed.compareTo(linkStat.accessed) < 0);
113 } 114 }
114 Expect.equals(7 << 6, linkStat.mode & (7 << 6)); // Includes +urwx. 115 Expect.equals(7 << 6, linkStat.mode & (7 << 6)); // Includes +urwx.
115 return directory.delete(recursive: true); 116 return directory.delete(recursive: true);
116 }); 117 });
117 }); 118 });
118 } 119 }
119 120
120 121
121 void main() { 122 void main() {
122 ReceivePort keepAlive = new ReceivePort(); 123 asyncStart();
123 testStat(); 124 testStat();
124 testStatAsync().then((_) => keepAlive.close()); 125 testStatAsync().then((_) => asyncEnd());
125 } 126 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_output_stream_test.dart ('k') | tests/standalone/io/file_system_async_links_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698