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

Unified Diff: pkg/watcher/test/directory_watcher/mac_os_test.dart

Issue 66163002: Wrap Directory.watch on Mac OS for the watcher package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/watcher/lib/src/utils.dart ('k') | pkg/watcher/test/directory_watcher/shared.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/watcher/test/directory_watcher/mac_os_test.dart
diff --git a/pkg/watcher/test/directory_watcher/linux_test.dart b/pkg/watcher/test/directory_watcher/mac_os_test.dart
similarity index 69%
copy from pkg/watcher/test/directory_watcher/linux_test.dart
copy to pkg/watcher/test/directory_watcher/mac_os_test.dart
index ba695698b64c4b7a5e9d6d431343b87db2b638b9..f7f8176ae33385399a75dfd13bf69dc99fea29bd 100644
--- a/pkg/watcher/test/directory_watcher/linux_test.dart
+++ b/pkg/watcher/test/directory_watcher/mac_os_test.dart
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:scheduled_test/scheduled_test.dart';
-import 'package:watcher/src/directory_watcher/linux.dart';
+import 'package:watcher/src/directory_watcher/mac_os.dart';
import 'package:watcher/watcher.dart';
import 'shared.dart';
@@ -12,22 +12,27 @@ import '../utils.dart';
main() {
initConfig();
- watcherFactory = (dir) => new LinuxDirectoryWatcher(dir);
+ watcherFactory = (dir) => new MacOSDirectoryWatcher(dir);
- setUp(() {
- // Increase the timeout because closing a [Directory.watch] stream blocks
- // the main isolate for a very long time on Goobuntu, as of kernel
- // 3.2.5-gg1336 (see issue 14606).
- currentSchedule.timeout *= 3;
-
- createSandbox();
- });
+ setUp(createSandbox);
sharedTests();
- test('DirectoryWatcher creates a LinuxDirectoryWatcher on Linux', () {
+ test('DirectoryWatcher creates a MacOSDirectoryWatcher on Mac OS', () {
expect(new DirectoryWatcher('.'),
- new isInstanceOf<LinuxDirectoryWatcher>());
+ new isInstanceOf<MacOSDirectoryWatcher>());
+ });
+
+ test('does not notify about the watched directory being deleted and '
+ 'recreated immediately before watching', () {
+ createDir("dir");
+ writeFile("dir/old.txt");
+ deleteDir("dir");
+ createDir("dir");
+
+ startWatcher(dir: "dir");
+ writeFile("dir/newer.txt");
+ expectAddEvent("dir/newer.txt");
});
test('notifies even if the file contents are unchanged', () {
« no previous file with comments | « pkg/watcher/lib/src/utils.dart ('k') | pkg/watcher/test/directory_watcher/shared.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698