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

Unified Diff: base/scoped_temp_dir_unittest.cc

Issue 1582022: Unpack extensions inside chrome's directory. (Closed)
Patch Set: Final rebase. Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/scoped_temp_dir.cc ('k') | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_temp_dir_unittest.cc
diff --git a/base/scoped_temp_dir_unittest.cc b/base/scoped_temp_dir_unittest.cc
index 72f4d8ce81169db94062deb15d09a2db8b51c9fa..4be0d076c5ff44f03f1c2bf0554aad0a911c4da3 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));
+}
« no previous file with comments | « base/scoped_temp_dir.cc ('k') | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698