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

Unified Diff: pkg/watcher/test/no_subscription/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/test/directory_watcher/shared.dart ('k') | pkg/watcher/test/path_set_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/watcher/test/no_subscription/mac_os_test.dart
diff --git a/pkg/watcher/test/no_subscription/mac_os_test.dart b/pkg/watcher/test/no_subscription/mac_os_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3862134d6e4d095045e78be43b7a2dbed03fbf5b
--- /dev/null
+++ b/pkg/watcher/test/no_subscription/mac_os_test.dart
@@ -0,0 +1,46 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:watcher/src/directory_watcher/mac_os.dart';
+import 'package:watcher/watcher.dart';
+
+import 'shared.dart';
+import '../utils.dart';
+
+// This is currently failing due to issue 14793. The reason is fairly complex:
+//
+// 1. As part of the test, an "unwatched.txt" file is created while there are no
+// active watchers on the containing directory.
+//
+// 2. A watcher is then added.
+//
+// 3. The watcher lists the contents of the directory and notices that
+// "unwatched.txt" already exists.
+//
+// 4. Since FSEvents reports past changes (issue 14373), the IO event stream
+// emits a CREATED event for "unwatched.txt".
+//
+// 5. Due to issue 14793, the watcher cannot trust that this is really a CREATED
+// event and checks the status of "unwatched.txt" on the filesystem against
+// its internal state.
+//
+// 6. "unwatched.txt" exists on the filesystem and the watcher knows about it
+// internally as well. It assumes this means that the file was modified.
+//
+// 7. The watcher emits an unexpected MODIFIED event for "unwatched.txt",
+// causing the test to fail.
+//
+// Once issue 14793 is fixed, this will no longer be the case and the test will
+// work again.
+
+main() {
+ initConfig();
+
+ watcherFactory = (dir) => new MacOSDirectoryWatcher(dir);
+
+ setUp(createSandbox);
+
+ sharedTests();
+}
« no previous file with comments | « pkg/watcher/test/directory_watcher/shared.dart ('k') | pkg/watcher/test/path_set_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698