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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « base/file_util_win.cc ('k') | base/files/file_util_proxy_unittest.cc » ('j') | no next file with comments »
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 FilePath test_file() { 165 FilePath test_file() {
166 return temp_dir_.path().AppendASCII("FilePathWatcherTest"); 166 return temp_dir_.path().AppendASCII("FilePathWatcherTest");
167 } 167 }
168 168
169 FilePath test_link() { 169 FilePath test_link() {
170 return temp_dir_.path().AppendASCII("FilePathWatcherTest.lnk"); 170 return temp_dir_.path().AppendASCII("FilePathWatcherTest.lnk");
171 } 171 }
172 172
173 // Write |content| to |file|. Returns true on success. 173 // Write |content| to |file|. Returns true on success.
174 bool WriteFile(const FilePath& file, const std::string& content) { 174 bool WriteFile(const FilePath& file, const std::string& content) {
175 int write_size = file_util::WriteFile(file, content.c_str(), 175 int write_size = ::base::WriteFile(file, content.c_str(), content.length());
176 content.length());
177 return write_size == static_cast<int>(content.length()); 176 return write_size == static_cast<int>(content.length());
178 } 177 }
179 178
180 bool SetupWatch(const FilePath& target, 179 bool SetupWatch(const FilePath& target,
181 FilePathWatcher* watcher, 180 FilePathWatcher* watcher,
182 TestDelegateBase* delegate, 181 TestDelegateBase* delegate,
183 bool recursive_watch) WARN_UNUSED_RESULT; 182 bool recursive_watch) WARN_UNUSED_RESULT;
184 183
185 bool WaitForEvents() WARN_UNUSED_RESULT { 184 bool WaitForEvents() WARN_UNUSED_RESULT {
186 collector_->Reset(); 185 collector_->Reset();
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, false)); 833 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, false));
835 ASSERT_TRUE(WaitForEvents()); 834 ASSERT_TRUE(WaitForEvents());
836 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true)); 835 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true));
837 DeleteDelegateOnFileThread(delegate.release()); 836 DeleteDelegateOnFileThread(delegate.release());
838 } 837 }
839 838
840 #endif // OS_MACOSX 839 #endif // OS_MACOSX
841 } // namespace 840 } // namespace
842 841
843 } // namespace base 842 } // namespace base
OLDNEW
« no previous file with comments | « base/file_util_win.cc ('k') | base/files/file_util_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698