Commit 1339dd16 authored by groby@chromium.org's avatar groby@chromium.org

Cleanup of code in WebDataService unittests

R=jhawkins@chromium.org
BUG=none
TEST=none


Review URL: http://codereview.chromium.org/7550053

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95908 0039d316-1c4b-4281-b951-d872f2087c98
parent 96bd27bc
...@@ -6,12 +6,11 @@ ...@@ -6,12 +6,11 @@
#include <vector> #include <vector>
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/file_util.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h" #include "base/memory/scoped_vector.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "base/path_service.h" #include "base/scoped_temp_dir.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/string16.h" #include "base/string16.h"
#include "base/string_util.h" #include "base/string_util.h"
...@@ -79,19 +78,14 @@ class WebDataServiceTest : public TestingBrowserProcessTest { ...@@ -79,19 +78,14 @@ class WebDataServiceTest : public TestingBrowserProcessTest {
virtual void SetUp() { virtual void SetUp() {
db_thread_.Start(); db_thread_.Start();
PathService::Get(chrome::DIR_TEST_DATA, &profile_dir_); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
const std::string test_profile = "WebDataServiceTest";
profile_dir_ = profile_dir_.AppendASCII(test_profile);
file_util::Delete(profile_dir_, true);
file_util::CreateDirectory(profile_dir_);
wds_ = new WebDataService(); wds_ = new WebDataService();
wds_->Init(profile_dir_); wds_->Init(temp_dir_.path());
} }
virtual void TearDown() { virtual void TearDown() {
if (wds_.get()) if (wds_.get())
wds_->Shutdown(); wds_->Shutdown();
file_util::Delete(profile_dir_, true);
db_thread_.Stop(); db_thread_.Stop();
MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask); MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask);
...@@ -103,6 +97,7 @@ class WebDataServiceTest : public TestingBrowserProcessTest { ...@@ -103,6 +97,7 @@ class WebDataServiceTest : public TestingBrowserProcessTest {
BrowserThread db_thread_; BrowserThread db_thread_;
FilePath profile_dir_; FilePath profile_dir_;
scoped_refptr<WebDataService> wds_; scoped_refptr<WebDataService> wds_;
ScopedTempDir temp_dir_;
}; };
class WebDataServiceAutofillTest : public WebDataServiceTest { class WebDataServiceAutofillTest : public WebDataServiceTest {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment