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

Unified Diff: pkg/watcher/test/directory_watcher_test.dart

Issue 22999008: Handle watching a non-existent directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 4 months 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/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/watcher/test/directory_watcher_test.dart
diff --git a/pkg/watcher/test/directory_watcher_test.dart b/pkg/watcher/test/directory_watcher_test.dart
index 9070179a9df6c9407ca852c9d6648415a30b6c93..841dd0808ecc8ccd05a8ed0cfe96b59d62d93691 100644
--- a/pkg/watcher/test/directory_watcher_test.dart
+++ b/pkg/watcher/test/directory_watcher_test.dart
@@ -86,4 +86,23 @@ main() {
writeFile("a/b/c/d/file.txt");
expectAddEvent("a/b/c/d/file.txt");
});
+
+ test('watches a directory created after the watcher', () {
+ // Watch a subdirectory that doesn't exist yet.
+ createWatcher(dir: "a");
+
+ // This implicity creates it.
+ writeFile("a/b/c/d/file.txt");
+ expectAddEvent("a/b/c/d/file.txt");
+ });
+
+ test('when the watched directory is deleted, removes all files', () {
+ writeFile("dir/a.txt");
+ writeFile("dir/b.txt");
+
+ createWatcher(dir: "dir");
+
+ deleteDir("dir");
+ expectRemoveEvents(["dir/a.txt", "dir/b.txt"]);
+ });
}
« no previous file with comments | « pkg/watcher/lib/src/utils.dart ('k') | pkg/watcher/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698