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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 using testing::Invoke; | 76 using testing::Invoke; |
77 using testing::InvokeWithoutArgs; | 77 using testing::InvokeWithoutArgs; |
78 using testing::Return; | 78 using testing::Return; |
79 using testing::SaveArg; | 79 using testing::SaveArg; |
80 using testing::SetArgumentPointee; | 80 using testing::SetArgumentPointee; |
81 using webkit::forms::PasswordForm; | 81 using webkit::forms::PasswordForm; |
82 | 82 |
83 ACTION_P3(MakePasswordSyncComponents, service, ps, dtc) { | 83 ACTION_P3(MakePasswordSyncComponents, service, ps, dtc) { |
84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
85 PasswordModelAssociator* model_associator = | 85 PasswordModelAssociator* model_associator = |
86 new PasswordModelAssociator(service, ps); | 86 new PasswordModelAssociator(service, ps, NULL); |
87 PasswordChangeProcessor* change_processor = | 87 PasswordChangeProcessor* change_processor = |
88 new PasswordChangeProcessor(model_associator, ps, dtc); | 88 new PasswordChangeProcessor(model_associator, ps, dtc); |
89 return ProfileSyncComponentsFactory::SyncComponents(model_associator, | 89 return ProfileSyncComponentsFactory::SyncComponents(model_associator, |
90 change_processor); | 90 change_processor); |
91 } | 91 } |
92 | 92 |
93 ACTION_P(AcquireSyncTransaction, password_test_service) { | 93 ACTION_P(AcquireSyncTransaction, password_test_service) { |
94 // Check to make sure we can aquire a transaction (will crash if a transaction | 94 // Check to make sure we can aquire a transaction (will crash if a transaction |
95 // is already held by this thread, deadlock if held by another thread). | 95 // is already held by this thread, deadlock if held by another thread). |
96 sync_api::WriteTransaction trans( | 96 sync_api::WriteTransaction trans( |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 CreateRootHelper create_root(this, syncable::PASSWORDS); | 586 CreateRootHelper create_root(this, syncable::PASSWORDS); |
587 StartSyncService(create_root.callback(), | 587 StartSyncService(create_root.callback(), |
588 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); | 588 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); |
589 | 589 |
590 std::vector<PasswordForm> new_sync_forms; | 590 std::vector<PasswordForm> new_sync_forms; |
591 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 591 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
592 | 592 |
593 EXPECT_EQ(1U, new_sync_forms.size()); | 593 EXPECT_EQ(1U, new_sync_forms.size()); |
594 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 594 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
595 } | 595 } |
OLD | NEW |