| 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/linux.dart'; | 6 import 'package:watcher/src/directory_watcher/linux.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 main() { | 12 main() { |
| 13 initConfig(); | 13 initConfig(); |
| 14 | 14 |
| 15 watcherFactory = (dir) => new LinuxDirectoryWatcher(dir); | 15 watcherFactory = (dir) => new LinuxDirectoryWatcher(dir); |
| 16 | 16 |
| 17 setUp(() { | 17 setUp(createSandbox); |
| 18 // Increase the timeout because closing a [Directory.watch] stream blocks | |
| 19 // the main isolate for a very long time on Goobuntu, as of kernel | |
| 20 // 3.2.5-gg1336 (see issue 14606). | |
| 21 currentSchedule.timeout *= 3; | |
| 22 | |
| 23 createSandbox(); | |
| 24 }); | |
| 25 | 18 |
| 26 sharedTests(); | 19 sharedTests(); |
| 27 | 20 |
| 28 test('DirectoryWatcher creates a LinuxDirectoryWatcher on Linux', () { | 21 test('DirectoryWatcher creates a LinuxDirectoryWatcher on Linux', () { |
| 29 expect(new DirectoryWatcher('.'), | 22 expect(new DirectoryWatcher('.'), |
| 30 new isInstanceOf<LinuxDirectoryWatcher>()); | 23 new isInstanceOf<LinuxDirectoryWatcher>()); |
| 31 }); | 24 }); |
| 32 | 25 |
| 33 test('notifies even if the file contents are unchanged', () { | 26 test('notifies even if the file contents are unchanged', () { |
| 34 writeFile("a.txt", contents: "same"); | 27 writeFile("a.txt", contents: "same"); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 53 withPermutations((i, j, k) => | 46 withPermutations((i, j, k) => |
| 54 expectRemoveEvent("dir/sub/sub-$i/sub-$j/file-$k.txt")); | 47 expectRemoveEvent("dir/sub/sub-$i/sub-$j/file-$k.txt")); |
| 55 }); | 48 }); |
| 56 | 49 |
| 57 inAnyOrder(() { | 50 inAnyOrder(() { |
| 58 withPermutations((i, j, k) => | 51 withPermutations((i, j, k) => |
| 59 expectAddEvent("dir/sub/sub-$i/sub-$j/file-$k.txt")); | 52 expectAddEvent("dir/sub/sub-$i/sub-$j/file-$k.txt")); |
| 60 }); | 53 }); |
| 61 }); | 54 }); |
| 62 } | 55 } |
| OLD | NEW |