| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 ASSERT_TRUE(db_thread_.Start()); | 111 ASSERT_TRUE(db_thread_.Start()); |
| 112 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 112 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 113 | 113 |
| 114 profile_.reset(new TestingProfile()); | 114 profile_.reset(new TestingProfile()); |
| 115 | 115 |
| 116 login_db_.reset(new LoginDatabase()); | 116 login_db_.reset(new LoginDatabase()); |
| 117 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( | 117 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( |
| 118 FILE_PATH_LITERAL("login_test")))); | 118 FILE_PATH_LITERAL("login_test")))); |
| 119 base::FilePath path = temp_dir_.path().AppendASCII("web_data_test"); | 119 base::FilePath path = temp_dir_.path().AppendASCII("web_data_test"); |
| 120 wdbs_ = new WebDatabaseService(path, | 120 wdbs_ = new WebDatabaseService(path, |
| 121 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); | 121 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 122 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB)); |
| 122 // Need to add at least one table so the database gets created. | 123 // Need to add at least one table so the database gets created. |
| 123 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable())); | 124 wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable())); |
| 124 wdbs_->LoadDatabase(); | 125 wdbs_->LoadDatabase(); |
| 125 wds_ = new WebDataService(wdbs_, | 126 wds_ = new WebDataService(wdbs_, |
| 126 WebDataServiceBase::ProfileErrorCallback()); | 127 WebDataServiceBase::ProfileErrorCallback()); |
| 127 wds_->Init(); | 128 wds_->Init(); |
| 128 } | 129 } |
| 129 | 130 |
| 130 virtual void TearDown() { | 131 virtual void TearDown() { |
| 131 if (store_.get()) | 132 if (store_.get()) |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 VectorOfForms expect_none; | 421 VectorOfForms expect_none; |
| 421 // expect that we get no results; | 422 // expect that we get no results; |
| 422 EXPECT_CALL( | 423 EXPECT_CALL( |
| 423 consumer, | 424 consumer, |
| 424 OnPasswordStoreRequestDone(_, ContainsAllPasswordForms(expect_none))) | 425 OnPasswordStoreRequestDone(_, ContainsAllPasswordForms(expect_none))) |
| 425 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); | 426 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); |
| 426 | 427 |
| 427 store_->GetAutofillableLogins(&consumer); | 428 store_->GetAutofillableLogins(&consumer); |
| 428 base::MessageLoop::current()->Run(); | 429 base::MessageLoop::current()->Run(); |
| 429 } | 430 } |
| OLD | NEW |