Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: components/password_manager/core/browser/password_syncable_service_unittest.cc

Issue 447333002: Address readability comments in PasswordSyncableService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the tests Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/password_manager/core/browser/password_syncable_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 684cfdcc53b40a890f9f36ee62caa99d2dcaa382..d673505a34cc62f60255eb5d0ff151ba8f2bbb5e 100644
--- a/components/password_manager/core/browser/password_syncable_service_unittest.cc
+++ b/components/password_manager/core/browser/password_syncable_service_unittest.cc
@@ -72,13 +72,14 @@ SyncData CreateSyncData(const std::string& signon_realm) {
password_specifics->set_type(autofill::PasswordForm::TYPE_GENERATED);
password_specifics->set_times_used(3);
- std::string tag = MakePasswordSyncTag(*password_specifics);
+ std::string tag = PasswordSyncableService::MakePasswordSyncTag(
+ *password_specifics);
return syncer::SyncData::CreateLocalData(tag, tag, password_data);
}
SyncChange CreateSyncChange(const autofill::PasswordForm& password,
SyncChange::SyncChangeType type) {
- SyncData data = SyncDataFromPassword(password);
+ SyncData data = PasswordSyncableService::SyncDataFromPassword(password);
return SyncChange(FROM_HERE, type, data);
}
@@ -211,7 +212,8 @@ void PasswordStoreDataVerifier::SetExpectedDBChanges(
for (SyncDataList::const_iterator it = add_forms.begin();
it != add_forms.end(); ++it) {
autofill::PasswordForm form;
- PasswordFromSpecifics(GetPasswordSpecifics(*it), &form);
+ PasswordSyncableService::PasswordFromSpecifics(GetPasswordSpecifics(*it),
+ &form);
expected_db_add_changes_.push_back(form);
}
if (expected_db_add_changes_.empty()) {
@@ -267,7 +269,8 @@ SyncError PasswordStoreDataVerifier::TestSyncChanges(
++expected_it) {
const sync_pb::PasswordSpecificsData& expected_password(
GetPasswordSpecifics(expected_it->sync_data()));
- if (actual_tag == MakePasswordSyncTag(expected_password)) {
+ if (actual_tag == PasswordSyncableService::MakePasswordSyncTag(
+ expected_password)) {
EXPECT_EQ(expected_it->change_type(), it->change_type());
matched = true;
if (it->change_type() != SyncChange::ACTION_DELETE)
@@ -289,8 +292,10 @@ PasswordStoreChangeList PasswordStoreDataVerifier::VerifyChange(
std::vector<autofill::PasswordForm>::iterator it = std::find_if(
password_list->begin(), password_list->end(), FormFinder(password));
EXPECT_NE(password_list->end(), it);
- PasswordsEqual(GetPasswordSpecifics(SyncDataFromPassword(*it)),
- GetPasswordSpecifics(SyncDataFromPassword(password)));
+ PasswordsEqual(
+ GetPasswordSpecifics(PasswordSyncableService::SyncDataFromPassword(*it)),
+ GetPasswordSpecifics(PasswordSyncableService::SyncDataFromPassword(
+ password)));
if (type != PasswordStoreChange::REMOVE) {
EXPECT_FALSE(password.date_synced.is_null()) << password.signon_realm;
EXPECT_FALSE(password.date_synced.is_max()) << password.signon_realm;
@@ -498,11 +503,11 @@ TEST_F(PasswordSyncableServiceTest, Merge) {
EXPECT_CALL(*service(), NotifyPasswordStoreOfLoginChanges(_));
- service()->MergeDataAndStartSyncing(syncer::PASSWORDS,
- SyncDataList(1,
- SyncDataFromPassword(form2)),
- CreateSyncChangeProcessor(),
- scoped_ptr<syncer::SyncErrorFactory>());
+ service()->MergeDataAndStartSyncing(
+ syncer::PASSWORDS,
+ SyncDataList(1, PasswordSyncableService::SyncDataFromPassword(form2)),
+ CreateSyncChangeProcessor(),
+ scoped_ptr<syncer::SyncErrorFactory>());
}
// Initiate sync due to local DB changes.
@@ -590,8 +595,10 @@ TEST_F(PasswordSyncableServiceTest, GetAllSyncData) {
SetPasswordStoreData(forms, blacklist_forms);
SyncDataList expected_list;
- expected_list.push_back(SyncDataFromPassword(*forms[0]));
- expected_list.push_back(SyncDataFromPassword(*blacklist_forms[0]));
+ expected_list.push_back(
+ PasswordSyncableService::SyncDataFromPassword(*forms[0]));
+ expected_list.push_back(
+ PasswordSyncableService::SyncDataFromPassword(*blacklist_forms[0]));
verifier()->SetExpectedDBChanges(SyncDataList(),
std::vector<autofill::PasswordForm*>(),
@@ -619,7 +626,8 @@ TEST_F(PasswordSyncableServiceTest, MergeDataAndPushBack) {
scoped_ptr<autofill::PasswordForm> form2(new autofill::PasswordForm);
form2->signon_realm = "xyz";
form2->action = GURL("http://bar.com");
- syncer::SyncData form2_sync_data = SyncDataFromPassword(*form2);
+ syncer::SyncData form2_sync_data =
+ PasswordSyncableService::SyncDataFromPassword(*form2);
other_service_wrapper.SetPasswordStoreData(
std::vector<autofill::PasswordForm*>(1, form2.release()),
std::vector<autofill::PasswordForm*>());
@@ -629,7 +637,7 @@ TEST_F(PasswordSyncableServiceTest, MergeDataAndPushBack) {
std::vector<autofill::PasswordForm*>(),
password_store());
other_service_wrapper.verifier()->SetExpectedDBChanges(
- SyncDataList(1, SyncDataFromPassword(*forms[0])),
+ SyncDataList(1, PasswordSyncableService::SyncDataFromPassword(*forms[0])),
std::vector<autofill::PasswordForm*>(),
std::vector<autofill::PasswordForm*>(),
other_service_wrapper.password_store());
« no previous file with comments | « components/password_manager/core/browser/password_syncable_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698