Chromium Code Reviews| Index: components/password_manager/core/browser/password_syncable_service_unittest.cc |
| diff --git a/components/password_manager/core/browser/password_syncable_service_unittest.cc b/components/password_manager/core/browser/password_syncable_service_unittest.cc |
| index f8533604ed8352ec3d1cd710d87be50b2e9a021e..8f51ddf8bf1740ca7f0f2815fb88a71eab5d76cc 100644 |
| --- a/components/password_manager/core/browser/password_syncable_service_unittest.cc |
| +++ b/components/password_manager/core/browser/password_syncable_service_unittest.cc |
| @@ -586,6 +586,29 @@ TEST_F(PasswordSyncableServiceTest, MergeEmptyPasswords) { |
| scoped_ptr<syncer::SyncErrorFactory>()); |
| } |
| +// Serialize and deserialize empty federation_origin and make sure it's an empty |
| +// string. |
| +TEST_F(PasswordSyncableServiceTest, SerializeEmptyFederation) { |
| + autofill::PasswordForm form; |
| + EXPECT_TRUE(form.federation_origin.unique()); |
| + syncer::SyncData data = SyncDataFromPassword(form); |
| + const sync_pb::PasswordSpecificsData& specifics = GetPasswordSpecifics(data); |
| + EXPECT_TRUE(specifics.has_federation_url()); |
| + EXPECT_EQ(std::string(), specifics.federation_url()); |
| + |
| + // Deserialize back. |
| + form = PasswordFromSpecifics(specifics); |
| + EXPECT_TRUE(form.federation_origin.unique()); |
| + |
| + // Make sure that the Origins uploaded incorrectly are still dwonloaded |
|
markusheintz_
2016/03/09 18:05:50
typo: downloaded
nit: They are not downloaded cor
vasilii
2016/03/09 18:11:20
Done.
|
| + // correctly. |
| + // crbug.com/589016. |
| + sync_pb::PasswordSpecificsData specifics1; |
| + specifics1.set_federation_url("null"); |
| + form = PasswordFromSpecifics(specifics1); |
| + EXPECT_TRUE(form.federation_origin.unique()); |
| +} |
| + |
| } // namespace |
| } // namespace password_manager |