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

Unified Diff: chrome/common/extensions/extension_unpacker_unittest.cc

Issue 6793008: Replacing base::DIR_TEMP with ScopedTempDir when appropriate. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Needed to rebase; patch didn't apply cleanly to save_package_unittest. Created 9 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 | « chrome/browser/ui/tests/browser_uitest.cc ('k') | chrome/common/json_pref_store_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_unpacker_unittest.cc
diff --git a/chrome/common/extensions/extension_unpacker_unittest.cc b/chrome/common/extensions/extension_unpacker_unittest.cc
index 930c2719465680c1b1bbb470cd74689a81d49b54..80ed7a59d359df329f92ec34974c41f33917c742 100644
--- a/chrome/common/extensions/extension_unpacker_unittest.cc
+++ b/chrome/common/extensions/extension_unpacker_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,7 @@
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/values.h"
+#include "base/memory/scoped_temp_dir.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_unpacker.h"
@@ -27,12 +28,9 @@ public:
// Try bots won't let us write into DIR_TEST_DATA, so we have to create
// a temp folder to play in.
- ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &install_dir_));
- install_dir_ = install_dir_.AppendASCII("extension_unpacker_test");
- file_util::Delete(install_dir_, true);
- file_util::CreateDirectory(install_dir_);
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- FilePath crx_path = install_dir_.AppendASCII(crx_name);
+ FilePath crx_path = temp_dir_.path().AppendASCII(crx_name);
ASSERT_TRUE(file_util::CopyFile(original_path, crx_path)) <<
"Original path " << original_path.value() <<
", Crx path " << crx_path.value();
@@ -40,13 +38,8 @@ public:
unpacker_.reset(new ExtensionUnpacker(crx_path));
}
- virtual void TearDown() {
- ASSERT_TRUE(file_util::Delete(install_dir_, true)) <<
- install_dir_.value();
- }
-
protected:
- FilePath install_dir_;
+ ScopedTempDir temp_dir_;
scoped_ptr<ExtensionUnpacker> unpacker_;
};
« no previous file with comments | « chrome/browser/ui/tests/browser_uitest.cc ('k') | chrome/common/json_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698