Commit 667faa2a authored by Caitlin Fischer's avatar Caitlin Fischer Committed by Commit Bot

Improve function names.

Bug: 1065897
Change-Id: Ie021c84c3474a3b35550618691f6f9082a09c25d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2130970Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
Cr-Commit-Position: refs/heads/master@{#755149}
parent c8fe3f19
......@@ -191,8 +191,8 @@ void AssertNumberOfEntities(int entity_count, syncer::ModelType entity_type) {
GREYAssertFalse([ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid
autofillProfileName:kFullName],
@"autofill profile should not exist");
[ChromeEarlGrey injectAutofillProfileOnFakeSyncServerWithGUID:kGuid
autofillProfileName:kFullName];
[ChromeEarlGrey addAutofillProfileToFakeSyncServerWithGUID:kGuid
autofillProfileName:kFullName];
[self setTearDownHandler:^{
[ChromeEarlGrey clearAutofillProfileWithGUID:kGuid];
}];
......@@ -220,8 +220,8 @@ void AssertNumberOfEntities(int entity_count, syncer::ModelType entity_type) {
autofillProfileName:kFullName],
@"autofill profile should not exist");
[ChromeEarlGrey injectAutofillProfileOnFakeSyncServerWithGUID:kGuid
autofillProfileName:kFullName];
[ChromeEarlGrey addAutofillProfileToFakeSyncServerWithGUID:kGuid
autofillProfileName:kFullName];
[self setTearDownHandler:^{
[ChromeEarlGrey clearAutofillProfileWithGUID:kGuid];
}];
......@@ -239,9 +239,8 @@ void AssertNumberOfEntities(int entity_count, syncer::ModelType entity_type) {
@"autofill profile should exist");
// Update autofill profile.
[ChromeEarlGrey
injectAutofillProfileOnFakeSyncServerWithGUID:kGuid
autofillProfileName:kUpdatedFullName];
[ChromeEarlGrey addAutofillProfileToFakeSyncServerWithGUID:kGuid
autofillProfileName:kUpdatedFullName];
// Trigger sync cycle and wait for update.
[ChromeEarlGrey triggerSyncCycleForType:syncer::AUTOFILL_PROFILE];
......@@ -267,8 +266,8 @@ void AssertNumberOfEntities(int entity_count, syncer::ModelType entity_type) {
GREYAssertFalse([ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid
autofillProfileName:kFullName],
@"autofill profile should not exist");
[ChromeEarlGrey injectAutofillProfileOnFakeSyncServerWithGUID:kGuid
autofillProfileName:kFullName];
[ChromeEarlGrey addAutofillProfileToFakeSyncServerWithGUID:kGuid
autofillProfileName:kFullName];
[self setTearDownHandler:^{
[ChromeEarlGrey clearAutofillProfileWithGUID:kGuid];
}];
......@@ -286,7 +285,7 @@ void AssertNumberOfEntities(int entity_count, syncer::ModelType entity_type) {
@"autofill profile should exist");
// Delete autofill profile from server, and verify it is removed.
[ChromeEarlGrey deleteAutofillProfileOnFakeSyncServerWithGUID:kGuid];
[ChromeEarlGrey deleteAutofillProfileFromFakeSyncServerWithGUID:kGuid];
[ChromeEarlGrey triggerSyncCycleForType:syncer::AUTOFILL_PROFILE];
ConditionBlock condition = ^{
return ![ChromeEarlGrey isAutofillProfilePresentWithGUID:kGuid
......
......@@ -52,12 +52,12 @@ void InjectLegacyBookmarkOnFakeSyncServer(
// Injects an autofill profile into the fake sync server with |guid| and
// |full_name|.
void InjectAutofillProfileOnFakeSyncServer(std::string guid,
std::string full_name);
void AddAutofillProfileToFakeSyncServer(std::string guid,
std::string full_name);
// Deletes an autofill profile from the fake sync server with |guid|, if it
// exists. If it doesn't exist, nothing is done.
void DeleteAutofillProfileOnFakeSyncServer(std::string guid);
void DeleteAutofillProfileFromFakeSyncServer(std::string guid);
// Clears the autofill profile for the given |guid|.
void ClearAutofillProfile(std::string guid);
......
......@@ -184,8 +184,8 @@ std::string GetSyncCacheGuid() {
return info_provider->GetLocalDeviceInfo()->guid();
}
void InjectAutofillProfileOnFakeSyncServer(std::string guid,
std::string full_name) {
void AddAutofillProfileToFakeSyncServer(std::string guid,
std::string full_name) {
DCHECK(gSyncFakeServer);
sync_pb::EntitySpecifics entity_specifics;
sync_pb::AutofillProfileSpecifics* autofill_profile =
......@@ -200,7 +200,7 @@ void InjectAutofillProfileOnFakeSyncServer(std::string guid,
gSyncFakeServer->InjectEntity(std::move(entity));
}
void DeleteAutofillProfileOnFakeSyncServer(std::string guid) {
void DeleteAutofillProfileFromFakeSyncServer(std::string guid) {
DCHECK(gSyncFakeServer);
std::vector<sync_pb::SyncEntity> autofill_profiles =
gSyncFakeServer->GetSyncEntitiesByModelType(syncer::AUTOFILL_PROFILE);
......
......@@ -160,9 +160,8 @@ id ExecuteJavaScript(NSString* javascript, NSError* __autoreleasing* out_error);
// Injects an autofill profile into the fake sync server with |GUID| and
// |full_name|.
- (void)injectAutofillProfileOnFakeSyncServerWithGUID:(const std::string&)GUID
autofillProfileName:
(const std::string&)fullName;
- (void)addAutofillProfileToFakeSyncServerWithGUID:(const std::string&)GUID
autofillProfileName:(const std::string&)fullName;
// Returns YES if there is an autofilll profile with the corresponding |GUID|
// and |full_name|.
......@@ -206,7 +205,8 @@ id ExecuteJavaScript(NSString* javascript, NSError* __autoreleasing* out_error);
// Deletes an autofill profile from the fake sync server with |GUID|, if it
// exists. If it doesn't exist, nothing is done.
- (void)deleteAutofillProfileOnFakeSyncServerWithGUID:(const std::string&)GUID;
- (void)deleteAutofillProfileFromFakeSyncServerWithGUID:
(const std::string&)GUID;
// Verifies the sessions hierarchy on the Sync FakeServer. |URLs| is
// the collection of URLs that are to be expected for a single window. A
......
......@@ -626,15 +626,14 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(ChromeEarlGreyAppInterface)
[ChromeEarlGreyAppInterface clearAutofillProfileWithGUID:GUID];
}
- (void)injectAutofillProfileOnFakeSyncServerWithGUID:
(const std::string&)UTF8GUID
autofillProfileName:
(const std::string&)UTF8FullName {
- (void)addAutofillProfileToFakeSyncServerWithGUID:(const std::string&)UTF8GUID
autofillProfileName:
(const std::string&)UTF8FullName {
NSString* GUID = base::SysUTF8ToNSString(UTF8GUID);
NSString* fullName = base::SysUTF8ToNSString(UTF8FullName);
[ChromeEarlGreyAppInterface
injectAutofillProfileOnFakeSyncServerWithGUID:GUID
autofillProfileName:fullName];
addAutofillProfileToFakeSyncServerWithGUID:GUID
autofillProfileName:fullName];
}
- (BOOL)isAutofillProfilePresentWithGUID:(const std::string&)UTF8GUID
......@@ -714,11 +713,11 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(ChromeEarlGreyAppInterface)
[ChromeEarlGreyAppInterface triggerSyncCycleForType:type];
}
- (void)deleteAutofillProfileOnFakeSyncServerWithGUID:
- (void)deleteAutofillProfileFromFakeSyncServerWithGUID:
(const std::string&)UTF8GUID {
NSString* GUID = base::SysUTF8ToNSString(UTF8GUID);
[ChromeEarlGreyAppInterface
deleteAutofillProfileOnFakeSyncServerWithGUID:GUID];
deleteAutofillProfileFromFakeSyncServerWithGUID:GUID];
}
- (void)waitForSyncInitialized:(BOOL)isInitialized
......
......@@ -236,8 +236,8 @@
// Injects an autofill profile into the fake sync server with |GUID| and
// |full_name|.
+ (void)injectAutofillProfileOnFakeSyncServerWithGUID:(NSString*)GUID
autofillProfileName:(NSString*)fullName;
+ (void)addAutofillProfileToFakeSyncServerWithGUID:(NSString*)GUID
autofillProfileName:(NSString*)fullName;
// Returns YES if there is an autofilll profile with the corresponding |GUID|
// and |full_name|.
......@@ -322,7 +322,7 @@
// Deletes an autofill profile from the fake sync server with |GUID|, if it
// exists. If it doesn't exist, nothing is done.
+ (void)deleteAutofillProfileOnFakeSyncServerWithGUID:(NSString*)GUID;
+ (void)deleteAutofillProfileFromFakeSyncServerWithGUID:(NSString*)GUID;
// Verifies the sessions hierarchy on the Sync FakeServer. |specs| is
// the collection of URLs that are to be expected for a single window. On
......
......@@ -432,11 +432,11 @@ NSString* SerializedPref(const PrefService::Preference* pref) {
chrome_test_util::ClearAutofillProfile(utfGUID);
}
+ (void)injectAutofillProfileOnFakeSyncServerWithGUID:(NSString*)GUID
autofillProfileName:(NSString*)fullName {
+ (void)addAutofillProfileToFakeSyncServerWithGUID:(NSString*)GUID
autofillProfileName:(NSString*)fullName {
std::string utfGUID = base::SysNSStringToUTF8(GUID);
std::string utfFullName = base::SysNSStringToUTF8(fullName);
chrome_test_util::InjectAutofillProfileOnFakeSyncServer(utfGUID, utfFullName);
chrome_test_util::AddAutofillProfileToFakeSyncServer(utfGUID, utfFullName);
}
+ (BOOL)isAutofillProfilePresentWithGUID:(NSString*)GUID
......@@ -521,8 +521,8 @@ NSString* SerializedPref(const PrefService::Preference* pref) {
chrome_test_util::TriggerSyncCycle(type);
}
+ (void)deleteAutofillProfileOnFakeSyncServerWithGUID:(NSString*)GUID {
chrome_test_util::DeleteAutofillProfileOnFakeSyncServer(
+ (void)deleteAutofillProfileFromFakeSyncServerWithGUID:(NSString*)GUID {
chrome_test_util::DeleteAutofillProfileFromFakeSyncServer(
base::SysNSStringToUTF8(GUID));
}
......
......@@ -152,8 +152,8 @@
GREYAssertTrue(![ChromeEarlGrey isAutofillProfilePresentWithGUID:fakeGUID
autofillProfileName:profileName],
@"Autofill profile should not be present.");
[ChromeEarlGrey injectAutofillProfileOnFakeSyncServerWithGUID:fakeGUID
autofillProfileName:profileName];
[ChromeEarlGrey addAutofillProfileToFakeSyncServerWithGUID:fakeGUID
autofillProfileName:profileName];
}
// Tests waitForSufficientlyVisibleElementWithMatcher in chrome_earl_grey.h
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment