diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-19 23:24:10 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-19 23:24:10 +0000 |
commit | 565758b5f9723fca2b71bb2dc411199d866042a6 (patch) | |
tree | d9eed038d75378994033c4cbbe0b915ea65caeb2 /base/scoped_temp_dir_unittest.cc | |
parent | 7e3449318db01c81b8f6674f67619b3fb01c11ad (diff) | |
download | chromium_src-565758b5f9723fca2b71bb2dc411199d866042a6.zip chromium_src-565758b5f9723fca2b71bb2dc411199d866042a6.tar.gz chromium_src-565758b5f9723fca2b71bb2dc411199d866042a6.tar.bz2 |
Fix file leaks in a ETW test and a ScopedTempDir test.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8972009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115036 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/scoped_temp_dir_unittest.cc')
-rw-r--r-- | base/scoped_temp_dir_unittest.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/base/scoped_temp_dir_unittest.cc b/base/scoped_temp_dir_unittest.cc index 72e410f..eddea83 100644 --- a/base/scoped_temp_dir_unittest.cc +++ b/base/scoped_temp_dir_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string> + #include "base/file_util.h" #include "base/platform_file.h" #include "base/scoped_temp_dir.h" @@ -60,8 +62,8 @@ TEST(ScopedTempDir, TempDir) { 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); + ASSERT_TRUE(file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("base_dir"), + &base_path)); FilePath test_path; { @@ -73,6 +75,7 @@ TEST(ScopedTempDir, UniqueTempDirUnderPath) { EXPECT_TRUE(test_path.value().find(base_path.value()) != std::string::npos); } EXPECT_FALSE(file_util::DirectoryExists(test_path)); + file_util::Delete(base_path, true); } TEST(ScopedTempDir, MultipleInvocations) { |