| 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 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 import 'package:watcher/src/directory_watcher/mac_os.dart'; | 6 import 'package:watcher/src/directory_watcher/mac_os.dart'; |
| 7 import 'package:watcher/watcher.dart'; | 7 import 'package:watcher/watcher.dart'; |
| 8 | 8 |
| 9 import 'shared.dart'; | 9 import 'shared.dart'; |
| 10 import '../utils.dart'; | 10 import '../utils.dart'; |
| 11 | 11 |
| 12 // This is currently failing due to issue 14793. The reason is fairly complex: | |
| 13 // | |
| 14 // 1. As part of the test, an "unwatched.txt" file is created while there are no | |
| 15 // active watchers on the containing directory. | |
| 16 // | |
| 17 // 2. A watcher is then added. | |
| 18 // | |
| 19 // 3. The watcher lists the contents of the directory and notices that | |
| 20 // "unwatched.txt" already exists. | |
| 21 // | |
| 22 // 4. Since FSEvents reports past changes (issue 14373), the IO event stream | |
| 23 // emits a CREATED event for "unwatched.txt". | |
| 24 // | |
| 25 // 5. Due to issue 14793, the watcher cannot trust that this is really a CREATED | |
| 26 // event and checks the status of "unwatched.txt" on the filesystem against | |
| 27 // its internal state. | |
| 28 // | |
| 29 // 6. "unwatched.txt" exists on the filesystem and the watcher knows about it | |
| 30 // internally as well. It assumes this means that the file was modified. | |
| 31 // | |
| 32 // 7. The watcher emits an unexpected MODIFIED event for "unwatched.txt", | |
| 33 // causing the test to fail. | |
| 34 // | |
| 35 // Once issue 14793 is fixed, this will no longer be the case and the test will | |
| 36 // work again. | |
| 37 | |
| 38 main() { | 12 main() { |
| 39 initConfig(); | 13 initConfig(); |
| 40 | 14 |
| 41 watcherFactory = (dir) => new MacOSDirectoryWatcher(dir); | 15 watcherFactory = (dir) => new MacOSDirectoryWatcher(dir); |
| 42 | 16 |
| 43 setUp(createSandbox); | 17 setUp(createSandbox); |
| 44 | 18 |
| 45 sharedTests(); | 19 sharedTests(); |
| 46 } | 20 } |
| OLD | NEW |