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

Unified Diff: ios/chrome/browser/context_menu/context_menu_egtest.mm

Issue 2777463002: Make custom GREYAction methods Chromium C-Style. (Closed)
Patch Set: more c-style Created 3 years, 9 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
Index: ios/chrome/browser/context_menu/context_menu_egtest.mm
diff --git a/ios/chrome/browser/context_menu/context_menu_egtest.mm b/ios/chrome/browser/context_menu/context_menu_egtest.mm
index 3d29a73b139420c3aef21b5c11cc0401bbf2711c..5de3cd5a817374574b9fe27a55846b516bc9af61 100644
--- a/ios/chrome/browser/context_menu/context_menu_egtest.mm
+++ b/ios/chrome/browser/context_menu/context_menu_egtest.mm
@@ -59,34 +59,35 @@ id<GREYMatcher> OpenImageInNewTabButton() {
// Waits for the context menu item to disappear. TODO(crbug.com/682871): Remove
// this once EarlGrey is synchronized with context menu.
-void WaitForContextMenuItemDisappeared(id<GREYMatcher> contextMenuItemButton) {
+void WaitForContextMenuItemDisappeared(
+ id<GREYMatcher> context_menu_item_button) {
ConditionBlock condition = ^{
NSError* error = nil;
- [[EarlGrey selectElementWithMatcher:contextMenuItemButton]
+ [[EarlGrey selectElementWithMatcher:context_menu_item_button]
assertWithMatcher:grey_nil()
error:&error];
return error == nil;
};
GREYAssert(testing::WaitUntilConditionOrTimeout(
testing::kWaitForUIElementTimeout, condition),
- @"Waiting for matcher %@ failed.", contextMenuItemButton);
+ @"Waiting for matcher %@ failed.", context_menu_item_button);
}
-// Long press on |elementId| to trigger context menu and then tap on
+// Long press on |element_id| to trigger context menu and then tap on
// |contextMenuItemButton| item.
-void LongPressElementAndTapOnButton(const char* elementId,
- id<GREYMatcher> contextMenuItemButton) {
- id<GREYMatcher> webViewMatcher =
+void LongPressElementAndTapOnButton(const char* element_id,
+ id<GREYMatcher> context_menu_item_button) {
+ id<GREYMatcher> web_view_matcher =
web::WebViewInWebState(chrome_test_util::GetCurrentWebState());
- [[EarlGrey selectElementWithMatcher:webViewMatcher]
- performAction:chrome_test_util::longPressElementForContextMenu(elementId,
- true)];
+ [[EarlGrey selectElementWithMatcher:web_view_matcher]
+ performAction:chrome_test_util::LongPressElementForContextMenu(
+ element_id, true /* menu should appear */)];
- [[EarlGrey selectElementWithMatcher:contextMenuItemButton]
+ [[EarlGrey selectElementWithMatcher:context_menu_item_button]
assertWithMatcher:grey_notNil()];
- [[EarlGrey selectElementWithMatcher:contextMenuItemButton]
+ [[EarlGrey selectElementWithMatcher:context_menu_item_button]
performAction:grey_tap()];
- WaitForContextMenuItemDisappeared(contextMenuItemButton);
+ WaitForContextMenuItemDisappeared(context_menu_item_button);
}
// A simple wrapper that sleeps for 1s to wait for the animation, triggered from
« no previous file with comments | « ios/chrome/browser/autofill/form_input_egtest.mm ('k') | ios/chrome/browser/ui/settings/block_popups_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698