OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 const FilePath login_db_file = temp_dir_.path().Append("login_test"); | 612 const FilePath login_db_file = temp_dir_.path().Append("login_test"); |
613 base::PlatformFileInfo db_file_start_info; | 613 base::PlatformFileInfo db_file_start_info; |
614 ASSERT_TRUE(file_util::GetFileInfo(login_db_file, &db_file_start_info)); | 614 ASSERT_TRUE(file_util::GetFileInfo(login_db_file, &db_file_start_info)); |
615 | 615 |
616 LoginDatabase* login_db = login_db_.get(); | 616 LoginDatabase* login_db = login_db_.get(); |
617 | 617 |
618 // Populate the login DB with logins that should be migrated. | 618 // Populate the login DB with logins that should be migrated. |
619 for (VectorOfForms::iterator it = expected_autofillable.begin(); | 619 for (VectorOfForms::iterator it = expected_autofillable.begin(); |
620 it != expected_autofillable.end(); ++it) { | 620 it != expected_autofillable.end(); ++it) { |
621 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 621 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
622 base::IgnoreReturn<bool>(base::Bind( | 622 base::Bind( |
623 &LoginDatabase::AddLogin, | 623 base::IgnoreResult(&LoginDatabase::AddLogin), |
624 base::Unretained(login_db), **it))); | 624 base::Unretained(login_db), **it)); |
625 } | 625 } |
626 for (VectorOfForms::iterator it = expected_blacklisted.begin(); | 626 for (VectorOfForms::iterator it = expected_blacklisted.begin(); |
627 it != expected_blacklisted.end(); ++it) { | 627 it != expected_blacklisted.end(); ++it) { |
628 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 628 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
629 base::IgnoreReturn<bool>(base::Bind( | 629 base::Bind( |
630 &LoginDatabase::AddLogin, | 630 base::IgnoreResult(&LoginDatabase::AddLogin), |
631 base::Unretained(login_db), **it))); | 631 base::Unretained(login_db), **it)); |
632 } | 632 } |
633 | 633 |
634 // Schedule another task on the DB thread to notify us that it's safe to | 634 // Schedule another task on the DB thread to notify us that it's safe to |
635 // carry on with the test. | 635 // carry on with the test. |
636 WaitableEvent done(false, false); | 636 WaitableEvent done(false, false); |
637 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 637 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
638 base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); | 638 base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); |
639 done.Wait(); | 639 done.Wait(); |
640 | 640 |
641 // Get the new size of the login DB file. We expect it to be larger. | 641 // Get the new size of the login DB file. We expect it to be larger. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 745 |
746 INSTANTIATE_TEST_CASE_P(NoBackend, | 746 INSTANTIATE_TEST_CASE_P(NoBackend, |
747 PasswordStoreXTest, | 747 PasswordStoreXTest, |
748 testing::Values(NO_BACKEND)); | 748 testing::Values(NO_BACKEND)); |
749 INSTANTIATE_TEST_CASE_P(FailingBackend, | 749 INSTANTIATE_TEST_CASE_P(FailingBackend, |
750 PasswordStoreXTest, | 750 PasswordStoreXTest, |
751 testing::Values(FAILING_BACKEND)); | 751 testing::Values(FAILING_BACKEND)); |
752 INSTANTIATE_TEST_CASE_P(WorkingBackend, | 752 INSTANTIATE_TEST_CASE_P(WorkingBackend, |
753 PasswordStoreXTest, | 753 PasswordStoreXTest, |
754 testing::Values(WORKING_BACKEND)); | 754 testing::Values(WORKING_BACKEND)); |
OLD | NEW |