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

Unified Diff: packages/watcher/test/directory_watcher/shared.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/watcher/pubspec.yaml ('k') | packages/watcher/test/file_watcher/native_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/watcher/test/directory_watcher/shared.dart
diff --git a/packages/watcher/test/directory_watcher/shared.dart b/packages/watcher/test/directory_watcher/shared.dart
index ff48cb2aaaf17ff46b7b5bc035e4d4b2b3dd5610..148eee26384b27fe7de45df5e0fd0ec32ac87b63 100644
--- a/packages/watcher/test/directory_watcher/shared.dart
+++ b/packages/watcher/test/directory_watcher/shared.dart
@@ -92,6 +92,23 @@ void sharedTests() {
]);
});
+ // Regression test for b/30768513.
+ test("doesn't crash when the directory is moved immediately after a subdir "
+ "is added", () {
+ writeFile("dir/a.txt");
+ writeFile("dir/b.txt");
+
+ startWatcher(path: "dir");
+
+ createDir("dir/subdir");
+ renameDir("dir", "moved_dir");
+ createDir("dir");
+ inAnyOrder([
+ isRemoveEvent("dir/a.txt"),
+ isRemoveEvent("dir/b.txt")
+ ]);
+ });
+
group("moves", () {
test('notifies when a file is moved within the watched directory', () {
writeFile("old.txt");
@@ -246,6 +263,37 @@ void sharedTests() {
expectModifyEvent("new/file.txt");
});
+ test('notifies when a file is replaced by a subdirectory', () {
+ writeFile("new");
+ writeFile("old/file.txt");
+ startWatcher();
+
+ deleteFile("new");
+ renameDir("old", "new");
+ inAnyOrder([
+ isRemoveEvent("new"),
+ isRemoveEvent("old/file.txt"),
+ isAddEvent("new/file.txt")
+ ]);
+ });
+
+ test('notifies when a subdirectory is replaced by a file', () {
+ writeFile("old");
+ writeFile("new/file.txt");
+ startWatcher();
+
+ renameDir("new", "newer");
+ renameFile("old", "new");
+ inAnyOrder([
+ isRemoveEvent("new/file.txt"),
+ isAddEvent("newer/file.txt"),
+ isRemoveEvent("old"),
+ isAddEvent("new")
+ ]);
+ }, onPlatform: {
+ "mac-os": new Skip("https://github.com/dart-lang/watcher/issues/21")
+ });
+
test('emits events for many nested files added at once', () {
withPermutations((i, j, k) =>
writeFile("sub/sub-$i/sub-$j/file-$k.txt"));
« no previous file with comments | « packages/watcher/pubspec.yaml ('k') | packages/watcher/test/file_watcher/native_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698