diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-07 22:19:50 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-07 22:19:50 +0000 |
commit | cfa428e0e42218b43f0c0b2486d2cc19b675d37d (patch) | |
tree | 7377cebabc3d676447cc1dcd564ec1cb9d17664c /base/directory_watcher_unittest.cc | |
parent | 861d4339e73a774ccd04401e1a90d5b5403e1e3f (diff) | |
download | chromium_src-cfa428e0e42218b43f0c0b2486d2cc19b675d37d.zip chromium_src-cfa428e0e42218b43f0c0b2486d2cc19b675d37d.tar.gz chromium_src-cfa428e0e42218b43f0c0b2486d2cc19b675d37d.tar.bz2 |
Don't DCHECK if a watched directory doesn't exist.
The caller can't easily check whether a directory exists before calling this
functions. Also modify GreasemonkeyMaster to allow this condition.
Review URL: http://codereview.chromium.org/16580
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/directory_watcher_unittest.cc')
-rw-r--r-- | base/directory_watcher_unittest.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/base/directory_watcher_unittest.cc b/base/directory_watcher_unittest.cc index 39f64bb..5e32a36 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, NonExistentDirectory) { + DirectoryWatcher watcher; + ASSERT_FALSE(watcher.Watch( + test_dir_.Append(FILE_PATH_LITERAL("does-not-exist")), this)); +} |