| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/task.h" | 9 #include "base/task.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 using testing::Eq; | 64 using testing::Eq; |
| 65 using testing::Invoke; | 65 using testing::Invoke; |
| 66 using testing::Return; | 66 using testing::Return; |
| 67 using testing::SaveArg; | 67 using testing::SaveArg; |
| 68 using testing::SetArgumentPointee; | 68 using testing::SetArgumentPointee; |
| 69 using webkit_glue::PasswordForm; | 69 using webkit_glue::PasswordForm; |
| 70 | 70 |
| 71 ACTION_P3(MakePasswordSyncComponents, service, ps, dtc) { | 71 ACTION_P3(MakePasswordSyncComponents, service, ps, dtc) { |
| 72 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); | 72 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); |
| 73 PasswordModelAssociator* model_associator = | 73 PasswordModelAssociator* model_associator = |
| 74 new PasswordModelAssociator(service, ps, dtc); | 74 new PasswordModelAssociator(service, ps); |
| 75 PasswordChangeProcessor* change_processor = | 75 PasswordChangeProcessor* change_processor = |
| 76 new PasswordChangeProcessor(model_associator, ps, dtc); | 76 new PasswordChangeProcessor(model_associator, ps, dtc); |
| 77 return ProfileSyncFactory::SyncComponents(model_associator, | 77 return ProfileSyncFactory::SyncComponents(model_associator, |
| 78 change_processor); | 78 change_processor); |
| 79 } | 79 } |
| 80 | 80 |
| 81 class MockPasswordStore : public PasswordStore { | 81 class MockPasswordStore : public PasswordStore { |
| 82 public: | 82 public: |
| 83 MOCK_METHOD1(RemoveLogin, void(const PasswordForm&)); | 83 MOCK_METHOD1(RemoveLogin, void(const PasswordForm&)); |
| 84 MOCK_METHOD2(GetLogins, int(const PasswordForm&, PasswordStoreConsumer*)); | 84 MOCK_METHOD2(GetLogins, int(const PasswordForm&, PasswordStoreConsumer*)); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 | 463 |
| 464 EXPECT_CALL(*(password_store_.get()), UpdateLoginImpl(_)).Times(1); | 464 EXPECT_CALL(*(password_store_.get()), UpdateLoginImpl(_)).Times(1); |
| 465 StartSyncService(&task); | 465 StartSyncService(&task); |
| 466 | 466 |
| 467 std::vector<PasswordForm> new_sync_forms; | 467 std::vector<PasswordForm> new_sync_forms; |
| 468 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 468 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
| 469 | 469 |
| 470 EXPECT_EQ(1U, new_sync_forms.size()); | 470 EXPECT_EQ(1U, new_sync_forms.size()); |
| 471 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 471 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
| 472 } | 472 } |
| OLD | NEW |