| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |