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

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

Issue 25471003: Modify tests to use Directory.systemTemp (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase 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
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 import "dart:async"; 5 import "dart:async";
6 import "dart:io"; 6 import "dart:io";
7 7
8 import "package:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
9 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
10 10
11 11
12 void testPauseList() { 12 void testPauseList() {
13 asyncStart(); 13 asyncStart();
14 // TOTAL should be bigger the our directory listing buffer. 14 // TOTAL should be bigger the our directory listing buffer.
15 const int TOTAL = 128; 15 const int TOTAL = 128;
16 new Directory("").createTemp().then((d) { 16 Directory.systemTemp.createTemp('dart_directory_list_pause').then((d) {
17 for (int i = 0; i < TOTAL; i++) { 17 for (int i = 0; i < TOTAL; i++) {
18 new Directory("${d.path}/$i").createSync(); 18 new Directory("${d.path}/$i").createSync();
19 new File("${d.path}/$i/file").createSync(); 19 new File("${d.path}/$i/file").createSync();
20 } 20 }
21 bool first = true; 21 bool first = true;
22 var subscription; 22 var subscription;
23 int count = 0; 23 int count = 0;
24 subscription = d.list(recursive: true).listen((file) { 24 subscription = d.list(recursive: true).listen((file) {
25 if (file is File) { 25 if (file is File) {
26 if (first) { 26 if (first) {
(...skipping 12 matching lines...) Expand all
39 Expect.notEquals(TOTAL, count); 39 Expect.notEquals(TOTAL, count);
40 Expect.isTrue(count > 0); 40 Expect.isTrue(count > 0);
41 d.delete(recursive: true).then((ignore) => asyncEnd()); 41 d.delete(recursive: true).then((ignore) => asyncEnd());
42 }); 42 });
43 }); 43 });
44 } 44 }
45 45
46 void main() { 46 void main() {
47 testPauseList(); 47 testPauseList();
48 } 48 }
OLDNEW
« no previous file with comments | « tests/standalone/io/directory_list_nonexistent_test.dart ('k') | tests/standalone/io/directory_non_ascii_sync_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698