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

Unified Diff: tests/standalone/io/file_system_watcher_test.dart

Issue 39613002: Close file watcher when target is deleted. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't always emit delete, and fix docs. Created 7 years, 2 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 | « sdk/lib/io/file_system_entity.dart ('k') | tools/create_sdk.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_system_watcher_test.dart
diff --git a/tests/standalone/io/file_system_watcher_test.dart b/tests/standalone/io/file_system_watcher_test.dart
index 6b37799c307dbdc26fdee8f836c269714895c916..4540b608f2d25641304806594088fa208c348976 100644
--- a/tests/standalone/io/file_system_watcher_test.dart
+++ b/tests/standalone/io/file_system_watcher_test.dart
@@ -111,6 +111,24 @@ void testWatchDeleteFile() {
}
+void testWatchDeleteDir() {
+ var dir = Directory.systemTemp.createTempSync('dart_file_system_watcher');
+ var watcher = dir.watch(events: 0);
+
+ asyncStart();
+ var sub;
+ sub = watcher.listen((event) {
+ if (event is FileSystemDeleteEvent) {
+ Expect.isTrue(event.path == dir.path);
+ }
+ }, onDone: () {
+ asyncEnd();
+ });
+
+ dir.deleteSync();
+}
+
+
void testWatchOnlyModifyFile() {
var dir = Directory.systemTemp.createTempSync('dart_file_system_watcher');
var file = new File(dir.path + '/file');
@@ -244,6 +262,7 @@ void main() {
testWatchModifyFile();
testWatchMoveFile();
testWatchDeleteFile();
+ testWatchDeleteDir();
testWatchOnlyModifyFile();
testMultipleEvents();
testWatchNonRecursive();
« no previous file with comments | « sdk/lib/io/file_system_entity.dart ('k') | tools/create_sdk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698