diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-08 15:47:07 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-08 15:47:07 +0000 |
commit | 67f3e65e1b7365184d6f439121fe9d36d41c1ced (patch) | |
tree | 1eeae0edccf34ae5ec89a14dd297506c6eeb6e48 /base | |
parent | bbceb0fd290f05efdb26ee71e5b56759462afcfb (diff) | |
download | chromium_src-67f3e65e1b7365184d6f439121fe9d36d41c1ced.zip chromium_src-67f3e65e1b7365184d6f439121fe9d36d41c1ced.tar.gz chromium_src-67f3e65e1b7365184d6f439121fe9d36d41c1ced.tar.bz2 |
Make Windows DirectoryWatcher also notify on directory operations (creation, etc).
TEST=DirectoryWatcherTest.* from base_unittests should pass on Windows.
http://crbug.com/11581
Review URL: http://codereview.chromium.org/115126
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15637 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/directory_watcher_unittest.cc | 4 | ||||
-rw-r--r-- | base/directory_watcher_win.cc | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/base/directory_watcher_unittest.cc b/base/directory_watcher_unittest.cc index 014665c..6a2abc9 100644 --- a/base/directory_watcher_unittest.cc +++ b/base/directory_watcher_unittest.cc @@ -332,15 +332,13 @@ TEST_F(DirectoryWatcherTest, WatchCreatedDirectory) { SetExpectedNumberOfNotifiedDelegates(1); FilePath subdir(CreateTestDirDirectoryASCII("SubDir", true)); - // Create a file inside the subdir to force Windows to fire notifications. - ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "some content")); VerifyExpectedNumberOfNotifiedDelegates(); delegate.reset(); // Verify that changes inside the subdir are noticed. SetExpectedNumberOfNotifiedDelegates(1); - ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "other content")); + ASSERT_TRUE(WriteTestFile(subdir.AppendASCII("test_file"), "some content")); VerifyExpectedNumberOfNotifiedDelegates(); } diff --git a/base/directory_watcher_win.cc b/base/directory_watcher_win.cc index 883c324..e75fe57 100644 --- a/base/directory_watcher_win.cc +++ b/base/directory_watcher_win.cc @@ -51,7 +51,7 @@ bool DirectoryWatcherImpl::Watch(const FilePath& path, path.value().c_str(), recursive, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE | - FILE_NOTIFY_CHANGE_LAST_WRITE); + FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_DIR_NAME); if (handle_ == INVALID_HANDLE_VALUE) return false; |