diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-20 23:12:48 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-20 23:12:48 +0000 |
commit | 296ddc16b04ee89a3b3b8d11b73d6f0c97d0be45 (patch) | |
tree | 1f5c455f0d2503dc2598a200b9104670c96b865a /chrome/browser/webdata/web_apps_table_unittest.cc | |
parent | 984aa49cf683761e8cba5eca4762d6727f484e4f (diff) | |
download | chromium_src-296ddc16b04ee89a3b3b8d11b73d6f0c97d0be45.zip chromium_src-296ddc16b04ee89a3b3b8d11b73d6f0c97d0be45.tar.gz chromium_src-296ddc16b04ee89a3b3b8d11b73d6f0c97d0be45.tar.bz2 |
Use ScopedTempDir instead of DIR_TEST_DATA for creating test data.
BUG=125513
TEST=git status
Review URL: https://chromiumcodereview.appspot.com/10386222
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/web_apps_table_unittest.cc')
-rw-r--r-- | chrome/browser/webdata/web_apps_table_unittest.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/chrome/browser/webdata/web_apps_table_unittest.cc b/chrome/browser/webdata/web_apps_table_unittest.cc index 24fd177..0b157f1 100644 --- a/chrome/browser/webdata/web_apps_table_unittest.cc +++ b/chrome/browser/webdata/web_apps_table_unittest.cc @@ -1,9 +1,10 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. #include "base/file_util.h" #include "base/path_service.h" +#include "base/scoped_temp_dir.h" #include "base/string_number_conversions.h" #include "base/time.h" #include "chrome/browser/webdata/web_apps_table.h" @@ -22,19 +23,12 @@ class WebAppsTableTest : public testing::Test { protected: virtual void SetUp() { - PathService::Get(chrome::DIR_TEST_DATA, &file_); - const std::string test_db = "TestWebDatabase" + - base::Int64ToString(Time::Now().ToTimeT()) + - ".db"; - file_ = file_.AppendASCII(test_db); - file_util::Delete(file_, false); - } - - virtual void TearDown() { - file_util::Delete(file_, false); + ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); + file_ = temp_dir_.path().AppendASCII("TestWebDatabase"); } FilePath file_; + ScopedTempDir temp_dir_; private: DISALLOW_COPY_AND_ASSIGN(WebAppsTableTest); |