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

Unified Diff: chrome/browser/extensions/extensions_service_unittest.cc

Issue 342085: Use more ScopedTempDirs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service_unittest.cc
===================================================================
--- chrome/browser/extensions/extensions_service_unittest.cc (revision 30756)
+++ chrome/browser/extensions/extensions_service_unittest.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/json/json_reader.h"
#include "base/message_loop.h"
#include "base/path_service.h"
+#include "base/scoped_temp_dir.h"
#include "base/string_util.h"
#include "chrome/browser/extensions/extension_creator.h"
#include "chrome/browser/extensions/extensions_service.h"
@@ -744,9 +745,10 @@
.AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
.AppendASCII("1.0.0.0");
- FilePath output_directory;
- file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome_"),
- &output_directory);
+ ScopedTempDir temp_dir;
+ ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
+ FilePath output_directory = temp_dir.path();
+
FilePath crx_path(output_directory.AppendASCII("ex1.crx"));
FilePath privkey_path(output_directory.AppendASCII("privkey.pem"));
@@ -756,9 +758,6 @@
ASSERT_TRUE(file_util::PathExists(privkey_path));
InstallExtension(crx_path, true);
-
- file_util::Delete(crx_path, false);
- file_util::Delete(privkey_path, false);
}
// Test Packaging and installing an extension using an openssl generated key.
@@ -781,9 +780,10 @@
"openssl_privkey_asn1.pem"));
ASSERT_TRUE(file_util::PathExists(privkey_path));
- FilePath output_directory;
- file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome_"),
- &output_directory);
+ ScopedTempDir temp_dir;
+ ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
+ FilePath output_directory = temp_dir.path();
+
FilePath crx_path(output_directory.AppendASCII("ex1.crx"));
scoped_ptr<ExtensionCreator> creator(new ExtensionCreator());
@@ -791,8 +791,6 @@
FilePath()));
InstallExtension(crx_path, true);
-
- file_util::Delete(crx_path, false);
}
TEST_F(ExtensionsServiceTest, InstallTheme) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698