| 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 "chrome/browser/password_manager/password_store_x.h" | 5 #include "chrome/browser/password_manager/password_store_x.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 base::ScopedTempDir temp_dir_; | 324 base::ScopedTempDir temp_dir_; |
| 325 BackendType backend_type_; | 325 BackendType backend_type_; |
| 326 scoped_refptr<PasswordStoreX> store_; | 326 scoped_refptr<PasswordStoreX> store_; |
| 327 | 327 |
| 328 DISALLOW_COPY_AND_ASSIGN(PasswordStoreXTestDelegate); | 328 DISALLOW_COPY_AND_ASSIGN(PasswordStoreXTestDelegate); |
| 329 }; | 329 }; |
| 330 | 330 |
| 331 PasswordStoreXTestDelegate::PasswordStoreXTestDelegate(BackendType backend_type) | 331 PasswordStoreXTestDelegate::PasswordStoreXTestDelegate(BackendType backend_type) |
| 332 : backend_type_(backend_type) { | 332 : backend_type_(backend_type) { |
| 333 SetupTempDir(); | 333 SetupTempDir(); |
| 334 store_ = new PasswordStoreX( | 334 store_ = new PasswordStoreX(base::ThreadTaskRunnerHandle::Get(), |
| 335 base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(), | 335 base::ThreadTaskRunnerHandle::Get(), |
| 336 base::WrapUnique( | 336 base::MakeUnique<password_manager::LoginDatabase>( |
| 337 new password_manager::LoginDatabase(test_login_db_file_path())), | 337 test_login_db_file_path()), |
| 338 GetBackend(backend_type_)); | 338 GetBackend(backend_type_)); |
| 339 store_->Init(syncer::SyncableService::StartSyncFlare()); | 339 store_->Init(syncer::SyncableService::StartSyncFlare()); |
| 340 } | 340 } |
| 341 | 341 |
| 342 PasswordStoreXTestDelegate::~PasswordStoreXTestDelegate() { | 342 PasswordStoreXTestDelegate::~PasswordStoreXTestDelegate() { |
| 343 store_->ShutdownOnUIThread(); | 343 store_->ShutdownOnUIThread(); |
| 344 FinishAsyncProcessing(); | 344 FinishAsyncProcessing(); |
| 345 } | 345 } |
| 346 | 346 |
| 347 void PasswordStoreXTestDelegate::FinishAsyncProcessing() { | 347 void PasswordStoreXTestDelegate::FinishAsyncProcessing() { |
| 348 base::RunLoop().RunUntilIdle(); | 348 base::RunLoop().RunUntilIdle(); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 583 |
| 584 INSTANTIATE_TEST_CASE_P(NoBackend, | 584 INSTANTIATE_TEST_CASE_P(NoBackend, |
| 585 PasswordStoreXTest, | 585 PasswordStoreXTest, |
| 586 testing::Values(NO_BACKEND)); | 586 testing::Values(NO_BACKEND)); |
| 587 INSTANTIATE_TEST_CASE_P(FailingBackend, | 587 INSTANTIATE_TEST_CASE_P(FailingBackend, |
| 588 PasswordStoreXTest, | 588 PasswordStoreXTest, |
| 589 testing::Values(FAILING_BACKEND)); | 589 testing::Values(FAILING_BACKEND)); |
| 590 INSTANTIATE_TEST_CASE_P(WorkingBackend, | 590 INSTANTIATE_TEST_CASE_P(WorkingBackend, |
| 591 PasswordStoreXTest, | 591 PasswordStoreXTest, |
| 592 testing::Values(WORKING_BACKEND)); | 592 testing::Values(WORKING_BACKEND)); |
| OLD | NEW |