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 import "package:path/path.dart"; | 10 import "package:path/path.dart"; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 }, onError: (e) { | 79 }, onError: (e) { |
80 dir.deleteSync(recursive: true); | 80 dir.deleteSync(recursive: true); |
81 throw e; | 81 throw e; |
82 }); | 82 }); |
83 | 83 |
84 file.writeAsStringSync('a'); | 84 file.writeAsStringSync('a'); |
85 } | 85 } |
86 | 86 |
87 | 87 |
88 void testWatchMoveFile() { | 88 void testWatchMoveFile() { |
| 89 // Mac OS doesn't report move events. |
| 90 if (Platform.isMacOS) return; |
89 var dir = Directory.systemTemp.createTempSync('dart_file_system_watcher'); | 91 var dir = Directory.systemTemp.createTempSync('dart_file_system_watcher'); |
90 var file = new File(join(dir.path, 'file')); | 92 var file = new File(join(dir.path, 'file')); |
91 file.createSync(); | 93 file.createSync(); |
92 | 94 |
93 var watcher = dir.watch(); | 95 var watcher = dir.watch(); |
94 | 96 |
95 asyncStart(); | 97 asyncStart(); |
96 var sub; | 98 var sub; |
97 sub = watcher.listen((event) { | 99 sub = watcher.listen((event) { |
98 if (event is FileSystemMoveEvent) { | 100 if (event is FileSystemMoveEvent) { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 testWatchModifyFile(); | 336 testWatchModifyFile(); |
335 testWatchMoveFile(); | 337 testWatchMoveFile(); |
336 testWatchDeleteFile(); | 338 testWatchDeleteFile(); |
337 testWatchDeleteDir(); | 339 testWatchDeleteDir(); |
338 testWatchOnlyModifyFile(); | 340 testWatchOnlyModifyFile(); |
339 testMultipleEvents(); | 341 testMultipleEvents(); |
340 testWatchNonRecursive(); | 342 testWatchNonRecursive(); |
341 testWatchNonExisting(); | 343 testWatchNonExisting(); |
342 testWatchMoveSelf(); | 344 testWatchMoveSelf(); |
343 } | 345 } |
OLD | NEW |