Index: chrome/browser/password_manager/password_store_default_unittest.cc |
=================================================================== |
--- chrome/browser/password_manager/password_store_default_unittest.cc (revision 134866) |
+++ chrome/browser/password_manager/password_store_default_unittest.cc (working copy) |
@@ -5,7 +5,6 @@ |
#include "base/basictypes.h" |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
-#include "base/scoped_temp_dir.h" |
#include "base/stl_util.h" |
#include "base/string_util.h" |
#include "base/synchronization/waitable_event.h" |
@@ -43,14 +42,14 @@ |
public: |
MOCK_METHOD2(OnPasswordStoreRequestDone, |
void(CancelableRequestProvider::Handle, |
- const std::vector<webkit::forms::PasswordForm*>&)); |
+ const std::vector<PasswordForm*>&)); |
}; |
// This class will add and remove a mock notification observer from |
// the DB thread. |
-class DBThreadObserverHelper : |
- public base::RefCountedThreadSafe<DBThreadObserverHelper, |
- BrowserThread::DeleteOnDBThread> { |
+class DBThreadObserverHelper |
+ : public base::RefCountedThreadSafe<DBThreadObserverHelper, |
+ BrowserThread::DeleteOnDBThread> { |
public: |
DBThreadObserverHelper() : done_event_(true, false) {} |
@@ -92,8 +91,6 @@ |
} // anonymous namespace |
-typedef std::vector<PasswordForm*> VectorOfForms; |
- |
class PasswordStoreDefaultTest : public testing::Test { |
protected: |
PasswordStoreDefaultTest() |
@@ -103,12 +100,11 @@ |
virtual void SetUp() { |
ASSERT_TRUE(db_thread_.Start()); |
- ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
profile_.reset(new TestingProfile()); |
login_db_.reset(new LoginDatabase()); |
- ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( |
+ ASSERT_TRUE(login_db_->Init(profile_->GetPath().Append( |
FILE_PATH_LITERAL("login_test")))); |
} |
@@ -125,7 +121,6 @@ |
scoped_ptr<LoginDatabase> login_db_; |
scoped_ptr<TestingProfile> profile_; |
- ScopedTempDir temp_dir_; |
}; |
ACTION(STLDeleteElements0) { |
@@ -143,7 +138,7 @@ |
store->Init(); |
// Some non-ASCII password form data. |
- PasswordFormData form_data[] = { |
+ static const PasswordFormData form_data[] = { |
{ PasswordForm::SCHEME_HTML, |
"http://foo.example.com", |
"http://foo.example.com/origin", |
@@ -157,7 +152,7 @@ |
}; |
// Build the expected forms vector and add the forms to the store. |
- VectorOfForms expected_forms; |
+ std::vector<PasswordForm*> expected_forms; |
for (unsigned int i = 0; i < ARRAYSIZE_UNSAFE(form_data); ++i) { |
PasswordForm* form = CreatePasswordFormFromData(form_data[i]); |
expected_forms.push_back(form); |
@@ -166,6 +161,8 @@ |
// The PasswordStore schedules tasks to run on the DB thread so we schedule |
// yet another task to notify us that it's safe to carry on with the test. |
+ // The PasswordStore doesn't really understand that it's "done" once the tasks |
+ // we posted above have completed, so there's no formal notification for that. |
WaitableEvent done(false, false); |
BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); |