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

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

Issue 47723003: Correctly pass errors to the stream, when watching file system entities. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « runtime/bin/file_patch.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 "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
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 file.createSync(); 249 file.createSync();
250 250
251 new Timer(const Duration(milliseconds: 300), () { 251 new Timer(const Duration(milliseconds: 300), () {
252 sub.cancel(); 252 sub.cancel();
253 asyncEnd(); 253 asyncEnd();
254 dir.deleteSync(recursive: true); 254 dir.deleteSync(recursive: true);
255 }); 255 });
256 } 256 }
257 257
258 258
259 void testWatchNonExisting() {
260 asyncStart();
261 new Directory('__some_none_existing_dir__').watch()
262 .listen((_) {
263 Expect.fail('unexpected error');
264 }, onError: (e) {
265 asyncEnd();
266 Expect.isTrue(e is FileSystemException);
267 });
268 }
269
270
259 void main() { 271 void main() {
260 if (!FileSystemEntity.isWatchSupported) return; 272 if (!FileSystemEntity.isWatchSupported) return;
261 testWatchCreateFile(); 273 testWatchCreateFile();
262 testWatchModifyFile(); 274 testWatchModifyFile();
263 testWatchMoveFile(); 275 testWatchMoveFile();
264 testWatchDeleteFile(); 276 testWatchDeleteFile();
265 testWatchDeleteDir(); 277 testWatchDeleteDir();
266 testWatchOnlyModifyFile(); 278 testWatchOnlyModifyFile();
267 testMultipleEvents(); 279 testMultipleEvents();
268 testWatchNonRecursive(); 280 testWatchNonRecursive();
281 testWatchNonExisting();
269 } 282 }
OLDNEW
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698