| 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..64a3fc00979c70c90063193322517eda0690b12d 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 deserialized
|
| + // correctly.
|
| + // crbug.com/593380.
|
| + sync_pb::PasswordSpecificsData specifics1;
|
| + specifics1.set_federation_url("null");
|
| + form = PasswordFromSpecifics(specifics1);
|
| + EXPECT_TRUE(form.federation_origin.unique());
|
| +}
|
| +
|
| } // namespace
|
|
|
| } // namespace password_manager
|
|
|