summaryrefslogtreecommitdiffstats
path: root/base/file_util_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Change the type of file_type parameter to int, as the parameter actually ↵haruki@chromium.org2012-08-121-11/+6
| | | | | | | | | | | | | takes or-ed bitmasks, to remove static_cast<> in the callers. BUG=139130 TEST=try bots Review URL: https://chromiumcodereview.appspot.com/10855002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151192 0039d316-1c4b-4281-b951-d872f2087c98
* Remove packaged app Windows shortcuts when app is uninstalled.benwells@chromium.org2012-08-101-3/+7
| | | | | | | | | | BUG=130456 TEST=Check app shortcuts are removed when the app is uninstalled. Test extension uninstallation in general. Review URL: https://chromiumcodereview.appspot.com/10837034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151021 0039d316-1c4b-4281-b951-d872f2087c98
* Add the methods to change and get a posix file permission to file_util. yoshiki@chromium.org2012-07-111-25/+166
| | | | | | | | | BUG=134821, 134820 TEST=both base_unittests:FileUtilTest.*, VerifyPathControlledByUserTest.* and unit_tests:Gdata* pass Review URL: https://chromiumcodereview.appspot.com/10756020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146020 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a bug in file_util::Delete() where symlinks are not handled rightyoshiki@chromium.org2012-06-301-0/+42
| | | | | | | | | | | With this patch, file_util::Delete() uses lstat64() instead of stat64(), so that Delete() checks the existence of the symbolic link itself not a file pointed by the symlink. This allows us to delete a symbolic link when it points to a non-existent file. BUG=119430 TEST=base_unittests::FileUtilTest.* passes. Review URL: https://chromiumcodereview.appspot.com/10690047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145060 0039d316-1c4b-4281-b951-d872f2087c98
* AppendToFile implementation.loislo@chromium.org2012-04-291-0/+28
| | | | | | | | | | | | | DevTools wants to save very big files like HeapSnapshots. It is not possible at the moment because the file can be about ~6Gb. BUG=none TEST=FileUtilTest.AppendToFile Review URL: http://codereview.chromium.org/10263003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134492 0039d316-1c4b-4281-b951-d872f2087c98
* Win 8 Start Menu shortcut changesgab@chromium.org2012-04-061-4/+5
| | | | | | | | | BUG=119242 TEST=Test DualModeApp properties are correctly set in Windows 8 on Start Menu shortcut. Review URL: http://codereview.chromium.org/9837120 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131163 0039d316-1c4b-4281-b951-d872f2087c98
* Add virtual and OVERRIDE to base/ implementation filesrsleevi@chromium.org2012-04-061-2/+2
| | | | | | | | | | BUG=none TEST=compiles Review URL: http://codereview.chromium.org/10004001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131098 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove deprecated version of file_util::AppendToPath().thestig@chromium.org2012-03-131-16/+0
| | | | | | | | | BUG=24672 TEST=none Review URL: http://codereview.chromium.org/9585001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126363 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Deprecate wstring version of file_util::CopyDirectory().thestig@chromium.org2012-03-031-19/+7
| | | | | | | | BUG=24672 TEST=none Review URL: https://chromiumcodereview.appspot.com/9484003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124819 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the CountFilesCreatedAfter test.gbillock@chromium.org2012-02-171-27/+16
| | | | | | | | | | | R=evan@chromium.org BUG=46246 TEST=FileUtilTest.CountFilesCreatedAfter Review URL: http://codereview.chromium.org/9419029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122443 0039d316-1c4b-4281-b951-d872f2087c98
* Flakiness cleanup: disable flaky tests under base/evan@chromium.org2012-02-141-1/+1
| | | | | | | | | | See https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/fcec09fc659f39a6 BUG=46246,85930,10611,86494,95058,61589,25038 Review URL: https://chromiumcodereview.appspot.com/9386014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121782 0039d316-1c4b-4281-b951-d872f2087c98
* Match whole path components in DevicePathToDriveLetterPath(). Add tests.skerner@chromium.org2012-01-171-1/+71
| | | | | | | | | | | | | +rvargas, who understands the code +brettw, who is in OWNERS BUG=109577 TEST=FileUtilTest.DevicePathToDriveLetter Review URL: http://codereview.chromium.org/9167004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117986 0039d316-1c4b-4281-b951-d872f2087c98
* Change code in base (primarily unit tests) to use Sleep(TimeDelta).tedvessenes@gmail.com2011-12-311-5/+4
| | | | | | | | | | BUG=108171 TEST= Review URL: http://codereview.chromium.org/9055001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116065 0039d316-1c4b-4281-b951-d872f2087c98
* GetPlatformFileInfo was always never returning directorycpu@chromium.org2011-12-291-1/+19
| | | | | | | | | | | - Because relational operators have higher precedence than bitwise operators BUG=none TEST=unittest included Review URL: http://codereview.chromium.org/9004052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115998 0039d316-1c4b-4281-b951-d872f2087c98
* Adaptively use temp dir instead of /dev/shm for executable shmem file on Linuxmcgrathr@chromium.org2011-12-061-1/+1
| | | | | | | | | | | | | | | | | On some Linux systems, files from /dev/shm cannot have PROT_EXEC applied to their mappings. This depends on picayune setup details that vary between distributions and kernels and could vary between installations. So just use an empirical test of whether it works or not, and fall back to using generic temporary space instead of /dev/shm for the executable case if needed. BUG= http://code.google.com/p/chromium/issues/detail?id=103377 TEST= SharedMemory.AnonymousExecutable with /dev/shm mounted noexec R=mark@chromium.org Review URL: http://codereview.chromium.org/8800025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113228 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the file_util_unittests.cc for Androidmichaelbai@chromium.org2011-10-251-0/+1
| | | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/8380022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107020 0039d316-1c4b-4281-b951-d872f2087c98
* Update write checks for external extension file on mac.skerner@chromium.org2011-10-171-45/+168
| | | | | | | | | | BUG=100565 TEST=VerifyPathControlledByUserTest.* Review URL: http://codereview.chromium.org/8318011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105923 0039d316-1c4b-4281-b951-d872f2087c98
* Get gid of created folders from stat()ing the folders, not from getgid().skerner@chromium.org2011-09-261-34/+9
| | | | | | | | | BUG=97876 TEST=VerifyPathControlledByUserTest.* Review URL: http://codereview.chromium.org/8037014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102748 0039d316-1c4b-4281-b951-d872f2087c98
* Mark VerifyPathControlledByUserTest.* as FAILS_ on mac.thakis@chromium.org2011-09-241-3/+31
| | | | | | | | | | | BUG=97876 TEST=none TBR=skerner Review URL: http://codereview.chromium.org/8036012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102662 0039d316-1c4b-4281-b951-d872f2087c98
* Add external extensions json source in proper mac location.skerner@google.com2011-09-221-0/+265
| | | | | | | | | | | The old path will be deprecated once developers have migrated. BUG=67203 TEST=FileUtilTest.IsPathControledByAdmin Review URL: http://codereview.chromium.org/7718021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102274 0039d316-1c4b-4281-b951-d872f2087c98
* Add a gyp flag to enable dcheck by default in release withoutnsylvain@chromium.org2011-09-201-1/+1
| | | | | | | | | having the pass a flag. This will be used on the try bots. BUG=96753 Review URL: http://codereview.chromium.org/7719007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102017 0039d316-1c4b-4281-b951-d872f2087c98
* base: Rename FileEnumerator::FILE_TYPE to FileEnumerator::FileType.tfarina@chromium.org2011-08-151-4/+4
| | | | | | | | | | | | | | enum types should be named using CamelCase as class and function names, not using MACRO_STYLE. BUG=None TEST=None R=evan@chromium.org Review URL: http://codereview.chromium.org/7618037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96766 0039d316-1c4b-4281-b951-d872f2087c98
* Removed wchat_t from Time::FromString.shinyak@google.com2011-08-031-2/+2
| | | | | | | | | | | | Also, some of the test case are moved for pr_time_unittests to time_unittests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/7492063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95207 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 94426 - Removed wchat_t from Time::FromString.morrita@chromium.org2011-07-281-2/+2
| | | | | | | | | | | | | | | Also, some of the test case are moved for pr_time_unittests to time_unitests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/7470038 TBR=shinyak@google.com Review URL: http://codereview.chromium.org/7520021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94427 0039d316-1c4b-4281-b951-d872f2087c98
* Removed wchat_t from Time::FromString.shinyak@google.com2011-07-281-2/+2
| | | | | | | | | | | | Also, some of the test case are moved for pr_time_unittests to time_unitests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/7470038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94426 0039d316-1c4b-4281-b951-d872f2087c98
* Move scoped_temp_dir and scoped_native_library back from base/memory to base.thakis@chromium.org2011-05-191-2/+2
| | | | | | | | | | | It looks like they got moved accidentally in http://codereview.chromium.org/6714032 BUG=none TEST=none Review URL: http://codereview.chromium.org/7048007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86010 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r83048 "Removed wchar_t from Time::FromString."maruel@chromium.org2011-04-261-2/+2
| | | | | | | | | | | | This causes regression on KeywordProviderTest.Edit on clang produced executable. TBR=shinyak BUG= TEST= Review URL: http://codereview.chromium.org/6893031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83055 0039d316-1c4b-4281-b951-d872f2087c98
* Removed wchar_t from Time::FromString.shinyak@google.com2011-04-261-2/+2
| | | | | | | | | | | | | Also, some of the test case are moved from pr_time_unittests to time_unittests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/6903022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83048 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Base unit tests: Small fix for two incorrect utilityrvargas@google.com2011-03-251-2/+2
| | | | | | | | | | functions of file_util_unittests BUG=none TEST=none Review URL: http://codereview.chromium.org/6747006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79454 0039d316-1c4b-4281-b951-d872f2087c98
* FilePath: Remove much of ToWStringHack, adding a LossyDisplayName()evan@chromium.org2011-02-041-2/+2
| | | | | | | | | | | | | | | The reason we don't want a free conversion between FilePaths and Unicode is that it can be lossy. But when displaying a string to the user, we're ok if it's lossy when we have no other option. This change introduces a LossyDisplayName() method that returns a string16, and converts many of the users of ToWStringHack to use it. BUG=69467 Review URL: http://codereview.chromium.org/6246036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73840 0039d316-1c4b-4281-b951-d872f2087c98
* Reland "Remove base/scoped_handle_win.h."tfarina@chromium.org2011-01-091-5/+8
| | | | | | | | | | | | | | | Fixed the problem with rlz library. Now should be fine to land this again. This reverts commit 3620d9501af7bff688862c54fdd60f7eb41797f3. Original Review URL: http://codereview.chromium.org/6126002/ BUG=None TEST=trybots Review URL: http://codereview.chromium.org/6110005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70861 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Remove base/scoped_handle_win.h stub and fix up all callers to use ↵thakis@chromium.org2011-01-071-8/+5
| | | | | | | | | | the new location and namespace." This reverts r 70795, it broke the build. TBR=vandebo git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70802 0039d316-1c4b-4281-b951-d872f2087c98
* Remove base/scoped_handle_win.h stub and fix up all callers to use the new ↵tfarina@chromium.org2011-01-071-5/+8
| | | | | | | | | | | location and namespace. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/6126002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70795 0039d316-1c4b-4281-b951-d872f2087c98
* Use FilePath::DirName instead of the deprecated file_util::GetDirectoryFromPath.tfarina@chromium.org2011-01-071-12/+0
| | | | | | | | | | | Fix the callers and remove the deprecated function. BUG=24672 TEST=trybots Review URL: http://codereview.chromium.org/6111003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70705 0039d316-1c4b-4281-b951-d872f2087c98
* base: Remove deprecated file_util::GetFilenameFromPath function.tfarina@chromium.org2011-01-061-11/+0
| | | | | | | | | BUG=24672 TEST=trybots Review URL: http://codereview.chromium.org/6057010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70610 0039d316-1c4b-4281-b951-d872f2087c98
* Move platform_thread to base/threading and put in the base namespace. I left abrettw@chromium.org2010-12-311-3/+3
| | | | | | | | | | | stub and "using" declarations in the old location to avoid having to change the entire project at once. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6001010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70342 0039d316-1c4b-4281-b951-d872f2087c98
* Some additions to support symlinks better on platforms that support them.gspencer@chromium.org2010-11-301-11/+40
| | | | | | | | | BUG=none TEST=Ran new unit test, passed trybots. Review URL: http://codereview.chromium.org/5349007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67631 0039d316-1c4b-4281-b951-d872f2087c98
* Add a TouchFile() function that takes a FilePath argument.dumi@chromium.org2010-09-231-3/+13
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3496005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60381 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add a TouchFile function that operates on FilePaths + fixing a bug"maruel@chromium.org2010-09-231-13/+3
| | | | | | | | | | | | This reverts commit 60322. TBR=dumi TEST=none BUG=none Review URL: http://codereview.chromium.org/3439019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60327 0039d316-1c4b-4281-b951-d872f2087c98
* Add a TouchFile function that operates on FilePaths + fixing a bugdumi@chromium.org2010-09-231-3/+13
| | | | | | | | | | | related to FILE_WRITE_ATTRIBUTES on Windows. BUG=none TEST=FileUtilTest::TouchFile Review URL: http://codereview.chromium.org/3404018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60322 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Fix FileUtilTest so multiple test instances can run in parallel.phajdan.jr@chromium.org2010-09-151-110/+106
| | | | | | | | | BUG=54098 TEST=base_unittests Review URL: http://codereview.chromium.org/3444003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59548 0039d316-1c4b-4281-b951-d872f2087c98
* Moving file_util::FileInfo to base::PlatformFileInfo, and adding thedumi@chromium.org2010-09-031-1/+1
| | | | | | | | | | | | last_accessed and creation_time fields. BUG=none TEST=none Review URL: http://codereview.chromium.org/3347005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58454 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded headers from base/ (part 7)thestig@chromium.org2010-08-271-1/+0
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3176026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57737 0039d316-1c4b-4281-b951-d872f2087c98
* Spelling correction: "nonexistant" -> "nonexistent".viettrungluu@chromium.org2010-08-221-1/+1
| | | | | | | | | BUG=none TEST=good spellers are slightly happier Review URL: http://codereview.chromium.org/3143037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57020 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of the deprecated file_util::InsertBeforeExtension.tfarina@chromium.org2010-08-181-63/+0
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3161018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56477 0039d316-1c4b-4281-b951-d872f2087c98
* Fix incorect tests against INVALID_FILE_HANDLE, as pointed out by cpu on ↵skerner@chromium.org2010-08-031-3/+3
| | | | | | | | | | | chrome-team. BUG=NONE TEST=FileUtilTest.NormalizeFilePath* Review URL: http://codereview.chromium.org/3031041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54701 0039d316-1c4b-4281-b951-d872f2087c98
* Remove some debug switches:skerner@chromium.org2010-07-301-1/+0
| | | | | | | | | | | | | | --issue35198-crxdir-browser --issue35198-permission They were used to understand issue 35198. They are no longer needed. There is one more switch, --issue35198-logging, that is not being removed in this CL. The logging it adds may still be useful. BUG=50604 TEST=manual Review URL: http://codereview.chromium.org/3052023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54323 0039d316-1c4b-4281-b951-d872f2087c98
* Remove <iostream> where possible.erg@google.com2010-07-201-1/+0
| | | | | | | | | | | | | <iostream> creates a static initializer. Most people don't need <iostream> anyway--they really need <ostream> for operator<< overloads. <iostream> should *never* be included in a header file; <iosfwd> exists for that purpose. BUG=none TEST=none Review URL: http://codereview.chromium.org/3014015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53083 0039d316-1c4b-4281-b951-d872f2087c98
* Deprecate most of the remaining wstring file_util functions.evan@chromium.org2010-07-081-0/+6
| | | | | | | | | | | | | These still exist on Windows due to being used by the installer, but by moving them into the Windows-only block we prevent them from being used in new code. (I am already finding new code using some of these! I am glad to be rid of them.) BUG=24672 Review URL: http://codereview.chromium.org/2850042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51862 0039d316-1c4b-4281-b951-d872f2087c98