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

Unified Diff: chrome/browser/webdata/web_data_service_unittest.cc

Issue 7550053: Cleanup of code in WebDataService unittests (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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 | « 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/webdata/web_data_service_unittest.cc
diff --git a/chrome/browser/webdata/web_data_service_unittest.cc b/chrome/browser/webdata/web_data_service_unittest.cc
index 7a328811f83e47f5ab4f7fcf6f5fcaa046561ada..0e884617d4b9f88474cd2b7b86b203204dec24f5 100644
--- a/chrome/browser/webdata/web_data_service_unittest.cc
+++ b/chrome/browser/webdata/web_data_service_unittest.cc
@@ -6,12 +6,11 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/message_loop.h"
-#include "base/path_service.h"
+#include "base/scoped_temp_dir.h"
#include "base/stl_util.h"
#include "base/string16.h"
#include "base/string_util.h"
@@ -78,19 +77,14 @@ class WebDataServiceTest : public testing::Test {
virtual void SetUp() {
db_thread_.Start();
- PathService::Get(chrome::DIR_TEST_DATA, &profile_dir_);
- const std::string test_profile = "WebDataServiceTest";
- profile_dir_ = profile_dir_.AppendASCII(test_profile);
- file_util::Delete(profile_dir_, true);
- file_util::CreateDirectory(profile_dir_);
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
wds_ = new WebDataService();
- wds_->Init(profile_dir_);
+ wds_->Init(temp_dir_.path());
}
virtual void TearDown() {
if (wds_.get())
wds_->Shutdown();
- file_util::Delete(profile_dir_, true);
db_thread_.Stop();
MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask);
@@ -102,6 +96,7 @@ class WebDataServiceTest : public testing::Test {
BrowserThread db_thread_;
FilePath profile_dir_;
scoped_refptr<WebDataService> wds_;
+ ScopedTempDir temp_dir_;
};
class WebDataServiceAutofillTest : public WebDataServiceTest {
« 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