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

Side by Side Diff: base/files/file_path_watcher_unittest.cc

Issue 2132593002: Remove remaining calls to deprecated MessageLoop methods on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove ios call sites Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/ios/weak_nsobject_unittest.mm » ('j') | base/test/ios/wait_util.mm » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 191
192 bool SetupWatch(const FilePath& target, 192 bool SetupWatch(const FilePath& target,
193 FilePathWatcher* watcher, 193 FilePathWatcher* watcher,
194 TestDelegateBase* delegate, 194 TestDelegateBase* delegate,
195 bool recursive_watch) WARN_UNUSED_RESULT; 195 bool recursive_watch) WARN_UNUSED_RESULT;
196 196
197 bool WaitForEvents() WARN_UNUSED_RESULT { 197 bool WaitForEvents() WARN_UNUSED_RESULT {
198 collector_->Reset(); 198 collector_->Reset();
199 // Make sure we timeout if we don't get notified. 199 // Make sure we timeout if we don't get notified.
200 loop_.PostDelayedTask(FROM_HERE, 200 loop_.task_runner()->PostDelayedTask(FROM_HERE,
201 MessageLoop::QuitWhenIdleClosure(), 201 MessageLoop::QuitWhenIdleClosure(),
202 TestTimeouts::action_timeout()); 202 TestTimeouts::action_timeout());
203 RunLoop().Run(); 203 RunLoop().Run();
204 return collector_->Success(); 204 return collector_->Success();
205 } 205 }
206 206
207 NotificationCollector* collector() { return collector_.get(); } 207 NotificationCollector* collector() { return collector_.get(); }
208 208
209 MessageLoop loop_; 209 MessageLoop loop_;
210 base::Thread file_thread_; 210 base::Thread file_thread_;
211 ScopedTempDir temp_dir_; 211 ScopedTempDir temp_dir_;
212 scoped_refptr<NotificationCollector> collector_; 212 scoped_refptr<NotificationCollector> collector_;
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, false)); 905 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, false));
906 ASSERT_TRUE(WaitForEvents()); 906 ASSERT_TRUE(WaitForEvents());
907 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true)); 907 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true));
908 DeleteDelegateOnFileThread(delegate.release()); 908 DeleteDelegateOnFileThread(delegate.release());
909 } 909 }
910 910
911 #endif // OS_MACOSX 911 #endif // OS_MACOSX
912 } // namespace 912 } // namespace
913 913
914 } // namespace base 914 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/ios/weak_nsobject_unittest.mm » ('j') | base/test/ios/wait_util.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698