OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <windows.h> | 5 #include <windows.h> |
6 #include <wincrypt.h> | 6 #include <wincrypt.h> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 virtual void SetUp() { | 108 virtual void SetUp() { |
109 ASSERT_TRUE(db_thread_.Start()); | 109 ASSERT_TRUE(db_thread_.Start()); |
110 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 110 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
111 | 111 |
112 profile_.reset(new TestingProfile()); | 112 profile_.reset(new TestingProfile()); |
113 | 113 |
114 login_db_.reset(new LoginDatabase()); | 114 login_db_.reset(new LoginDatabase()); |
115 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( | 115 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( |
116 FILE_PATH_LITERAL("login_test")))); | 116 FILE_PATH_LITERAL("login_test")))); |
117 wds_ = new WebDataService(WebDataServiceBase::ProfileErrorCallback()); | |
118 base::FilePath path = temp_dir_.path().AppendASCII("web_data_test"); | 117 base::FilePath path = temp_dir_.path().AppendASCII("web_data_test"); |
119 wds_->Init(path); | 118 wds_ = new WebDataService(path, |
| 119 WebDataServiceBase::ProfileErrorCallback()); |
| 120 wds_->Init(); |
120 } | 121 } |
121 | 122 |
122 virtual void TearDown() { | 123 virtual void TearDown() { |
123 if (store_.get()) | 124 if (store_.get()) |
124 store_->ShutdownOnUIThread(); | 125 store_->ShutdownOnUIThread(); |
125 wds_->ShutdownOnUIThread(); | 126 wds_->ShutdownOnUIThread(); |
126 wds_ = NULL; | 127 wds_ = NULL; |
127 base::WaitableEvent done(false, false); | 128 base::WaitableEvent done(false, false); |
128 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 129 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
129 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 130 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 VectorOfForms expect_none; | 409 VectorOfForms expect_none; |
409 // expect that we get no results; | 410 // expect that we get no results; |
410 EXPECT_CALL( | 411 EXPECT_CALL( |
411 consumer, | 412 consumer, |
412 OnPasswordStoreRequestDone(_, ContainsAllPasswordForms(expect_none))) | 413 OnPasswordStoreRequestDone(_, ContainsAllPasswordForms(expect_none))) |
413 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); | 414 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); |
414 | 415 |
415 store_->GetAutofillableLogins(&consumer); | 416 store_->GetAutofillableLogins(&consumer); |
416 MessageLoop::current()->Run(); | 417 MessageLoop::current()->Run(); |
417 } | 418 } |
OLD | NEW |