diff options
author | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 17:00:09 +0000 |
---|---|---|
committer | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 17:00:09 +0000 |
commit | b0b3abd98a59384a83349c83a5ef9b14851816da (patch) | |
tree | 790628087c773280456dffae7cfb0ea8f744649f /base/scoped_temp_dir_unittest.cc | |
parent | ec2717e405abc8f618133fe3c9f5051fff224e71 (diff) | |
download | chromium_src-b0b3abd98a59384a83349c83a5ef9b14851816da.zip chromium_src-b0b3abd98a59384a83349c83a5ef9b14851816da.tar.gz chromium_src-b0b3abd98a59384a83349c83a5ef9b14851816da.tar.bz2 |
Unpack extensions inside chrome's profile directory.
Other users of the temp directory will be altered in a subsequent CL.
BUG=13044
TEST=SandboxedExtensionUnpackerTest.*, ScopedTempDir.UniqueTempDirUnderPath, FileUtilTest.CreateNewTempDirInDirTest, manual testing on win, linux, mac.
Review URL: http://codereview.chromium.org/1582022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/scoped_temp_dir_unittest.cc')
-rw-r--r-- | base/scoped_temp_dir_unittest.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/base/scoped_temp_dir_unittest.cc b/base/scoped_temp_dir_unittest.cc index 72f4d8c..4be0d07 100644 --- a/base/scoped_temp_dir_unittest.cc +++ b/base/scoped_temp_dir_unittest.cc @@ -55,3 +55,21 @@ TEST(ScopedTempDir, TempDir) { } EXPECT_FALSE(file_util::DirectoryExists(test_path)); } + +TEST(ScopedTempDir, UniqueTempDirUnderPath) { + // Create a path which will contain a unique temp path. + FilePath base_path; + file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("base_dir"), + &base_path); + + FilePath test_path; + { + ScopedTempDir dir; + EXPECT_TRUE(dir.CreateUniqueTempDirUnderPath(base_path)); + test_path = dir.path(); + EXPECT_TRUE(file_util::DirectoryExists(test_path)); + EXPECT_TRUE(base_path.IsParent(test_path)); + EXPECT_TRUE(test_path.value().find(base_path.value()) != std::string::npos); + } + EXPECT_FALSE(file_util::DirectoryExists(test_path)); +} |