OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/files/file_path_watcher.h" | 5 #include "base/files/file_path_watcher.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <aclapi.h> | 9 #include <aclapi.h> |
10 #elif defined(OS_POSIX) | 10 #elif defined(OS_POSIX) |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 return collector_->Success(); | 185 return collector_->Success(); |
186 } | 186 } |
187 | 187 |
188 NotificationCollector* collector() { return collector_.get(); } | 188 NotificationCollector* collector() { return collector_.get(); } |
189 | 189 |
190 MessageLoop loop_; | 190 MessageLoop loop_; |
191 base::Thread file_thread_; | 191 base::Thread file_thread_; |
192 ScopedTempDir temp_dir_; | 192 ScopedTempDir temp_dir_; |
193 scoped_refptr<NotificationCollector> collector_; | 193 scoped_refptr<NotificationCollector> collector_; |
194 | 194 |
| 195 private: |
195 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherTest); | 196 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherTest); |
196 }; | 197 }; |
197 | 198 |
198 bool FilePathWatcherTest::SetupWatch(const FilePath& target, | 199 bool FilePathWatcherTest::SetupWatch(const FilePath& target, |
199 FilePathWatcher* watcher, | 200 FilePathWatcher* watcher, |
200 TestDelegateBase* delegate, | 201 TestDelegateBase* delegate, |
201 bool recursive_watch) { | 202 bool recursive_watch) { |
202 base::WaitableEvent completion(false, false); | 203 base::WaitableEvent completion(false, false); |
203 bool result; | 204 bool result; |
204 file_thread_.message_loop_proxy()->PostTask( | 205 file_thread_.message_loop_proxy()->PostTask( |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, false)); | 862 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, false)); |
862 ASSERT_TRUE(WaitForEvents()); | 863 ASSERT_TRUE(WaitForEvents()); |
863 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true)); | 864 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true)); |
864 DeleteDelegateOnFileThread(delegate.release()); | 865 DeleteDelegateOnFileThread(delegate.release()); |
865 } | 866 } |
866 | 867 |
867 #endif // OS_MACOSX | 868 #endif // OS_MACOSX |
868 } // namespace | 869 } // namespace |
869 | 870 |
870 } // namespace base | 871 } // namespace base |
OLD | NEW |