| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 public: | 95 public: |
| 96 PasswordTestProfileSyncService( | 96 PasswordTestProfileSyncService( |
| 97 ProfileSyncComponentsFactory* factory, | 97 ProfileSyncComponentsFactory* factory, |
| 98 Profile* profile, | 98 Profile* profile, |
| 99 SigninManagerBase* signin, | 99 SigninManagerBase* signin, |
| 100 ProfileOAuth2TokenService* oauth2_token_service) | 100 ProfileOAuth2TokenService* oauth2_token_service) |
| 101 : TestProfileSyncService(factory, | 101 : TestProfileSyncService(factory, |
| 102 profile, | 102 profile, |
| 103 signin, | 103 signin, |
| 104 oauth2_token_service, | 104 oauth2_token_service, |
| 105 ProfileSyncService::AUTO_START) {} | 105 browser_sync::AUTO_START) {} |
| 106 | 106 |
| 107 virtual ~PasswordTestProfileSyncService() {} | 107 virtual ~PasswordTestProfileSyncService() {} |
| 108 | 108 |
| 109 virtual void OnPassphraseAccepted() OVERRIDE { | 109 virtual void OnPassphraseAccepted() OVERRIDE { |
| 110 if (!callback_.is_null()) | 110 if (!callback_.is_null()) |
| 111 callback_.Run(); | 111 callback_.Run(); |
| 112 | 112 |
| 113 TestProfileSyncService::OnPassphraseAccepted(); | 113 TestProfileSyncService::OnPassphraseAccepted(); |
| 114 } | 114 } |
| 115 | 115 |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 CreateRootHelper create_root(this, syncer::PASSWORDS); | 668 CreateRootHelper create_root(this, syncer::PASSWORDS); |
| 669 StartSyncService(create_root.callback(), | 669 StartSyncService(create_root.callback(), |
| 670 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); | 670 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); |
| 671 | 671 |
| 672 std::vector<PasswordForm> new_sync_forms; | 672 std::vector<PasswordForm> new_sync_forms; |
| 673 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 673 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
| 674 | 674 |
| 675 EXPECT_EQ(1U, new_sync_forms.size()); | 675 EXPECT_EQ(1U, new_sync_forms.size()); |
| 676 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 676 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
| 677 } | 677 } |
| OLD | NEW |