Chromium Code Reviews| 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..8213575d0184c9dc6ea32b12c8803406c2be962a 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(); |
| @@ -41,12 +39,10 @@ public: |
| } |
| virtual void TearDown() { |
|
Paweł Hajdan Jr.
2011/04/08 15:58:17
An empty TearDown can be removed.
Mike West
2011/04/11 14:47:04
Done.
|
| - ASSERT_TRUE(file_util::Delete(install_dir_, true)) << |
| - install_dir_.value(); |
| } |
| protected: |
| - FilePath install_dir_; |
| + ScopedTempDir temp_dir_; |
| scoped_ptr<ExtensionUnpacker> unpacker_; |
| }; |