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

Unified Diff: base/directory_watcher_unittest.cc

Issue 16580: Don't DCHECK if a watched directory doesn't exist. (Closed)
Patch Set: Created 11 years, 11 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 | « no previous file | base/directory_watcher_win.cc » ('j') | base/directory_watcher_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/directory_watcher_unittest.cc
diff --git a/base/directory_watcher_unittest.cc b/base/directory_watcher_unittest.cc
index 39f64bb8b072d4312a9296f194975937ec8e06a1..1095c2b4b9f3c408b7fefb99a8242a2c16fac6cf 100644
--- a/base/directory_watcher_unittest.cc
+++ b/base/directory_watcher_unittest.cc
@@ -184,3 +184,12 @@ TEST_F(DirectoryWatcherTest, DeleteDuringNotify) {
// Might as well double-check it got deleted, too.
ASSERT_TRUE(deleter.watcher_.get() == NULL);
}
+
+// Verify that watching a directory that doesn't exist fails, but doesn't
+// asssert.
+// Basic test: add a file and verify we notice it.
+TEST_F(DirectoryWatcherTest, NonExistantDirectory) {
Evan Martin 2009/01/07 18:47:57 s/Existant/Existent/
+ DirectoryWatcher watcher;
+ ASSERT_FALSE(watcher.Watch(
+ test_dir_.Append(FILE_PATH_LITERAL("does-not-exist")), this));
+}
« no previous file with comments | « no previous file | base/directory_watcher_win.cc » ('j') | base/directory_watcher_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698