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

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

Issue 17265003: Avoid double-// on directory listing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
« no previous file with comments | « sdk/lib/io/directory_impl.dart ('k') | no next file » | 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:async"; 6 import "dart:async";
7 import "dart:io"; 7 import "dart:io";
8 import "dart:isolate"; 8 import "dart:isolate";
9 9
10 10
11 void testPauseList() { 11 void testPauseList() {
12 var keepAlive = new ReceivePort(); 12 var keepAlive = new ReceivePort();
13 // TOTAL should be bigger the our directory listing buffer. 13 // TOTAL should be bigger the our directory listing buffer.
14 const int TOTAL = 256; 14 const int TOTAL = 128;
15 new Directory("").createTemp().then((d) { 15 new Directory("").createTemp().then((d) {
16 for (int i = 0; i < TOTAL; i++) { 16 for (int i = 0; i < TOTAL; i++) {
17 new Directory("${d.path}/$i").createSync(); 17 new Directory("${d.path}/$i").createSync();
18 new File("${d.path}/$i/file").createSync(); 18 new File("${d.path}/$i/file").createSync();
19 } 19 }
20 bool first = true; 20 bool first = true;
21 var subscription; 21 var subscription;
22 int count = 0; 22 int count = 0;
23 subscription = d.list(recursive: true).listen((file) { 23 subscription = d.list(recursive: true).listen((file) {
24 if (file is File) { 24 if (file is File) {
(...skipping 13 matching lines...) Expand all
38 Expect.notEquals(TOTAL, count); 38 Expect.notEquals(TOTAL, count);
39 Expect.isTrue(count > 0); 39 Expect.isTrue(count > 0);
40 d.delete(recursive: true).then((ignore) => keepAlive.close()); 40 d.delete(recursive: true).then((ignore) => keepAlive.close());
41 }); 41 });
42 }); 42 });
43 } 43 }
44 44
45 void main() { 45 void main() {
46 testPauseList(); 46 testPauseList();
47 } 47 }
OLDNEW
« no previous file with comments | « sdk/lib/io/directory_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698