| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 protected: | 154 protected: |
| 155 ProfileSyncServicePasswordTest() {} | 155 ProfileSyncServicePasswordTest() {} |
| 156 | 156 |
| 157 virtual void SetUp() { | 157 virtual void SetUp() { |
| 158 AbstractProfileSyncServiceTest::SetUp(); | 158 AbstractProfileSyncServiceTest::SetUp(); |
| 159 profile_.CreateRequestContext(); | 159 profile_.CreateRequestContext(); |
| 160 password_store_ = static_cast<MockPasswordStore*>( | 160 password_store_ = static_cast<MockPasswordStore*>( |
| 161 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( | 161 PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( |
| 162 &profile_, MockPasswordStore::Build)); | 162 &profile_, MockPasswordStore::Build).get()); |
| 163 | 163 |
| 164 registrar_.Add(&observer_, | 164 registrar_.Add(&observer_, |
| 165 chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, | 165 chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, |
| 166 content::NotificationService::AllSources()); | 166 content::NotificationService::AllSources()); |
| 167 registrar_.Add(&observer_, | 167 registrar_.Add(&observer_, |
| 168 chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED, | 168 chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED, |
| 169 content::NotificationService::AllSources()); | 169 content::NotificationService::AllSources()); |
| 170 } | 170 } |
| 171 | 171 |
| 172 virtual void TearDown() { | 172 virtual void TearDown() { |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 CreateRootHelper create_root(this, syncable::PASSWORDS); | 588 CreateRootHelper create_root(this, syncable::PASSWORDS); |
| 589 StartSyncService(create_root.callback(), | 589 StartSyncService(create_root.callback(), |
| 590 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); | 590 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); |
| 591 | 591 |
| 592 std::vector<PasswordForm> new_sync_forms; | 592 std::vector<PasswordForm> new_sync_forms; |
| 593 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 593 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
| 594 | 594 |
| 595 EXPECT_EQ(1U, new_sync_forms.size()); | 595 EXPECT_EQ(1U, new_sync_forms.size()); |
| 596 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 596 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
| 597 } | 597 } |
| OLD | NEW |