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

Unified Diff: ios/chrome/browser/ui/tab_switcher/tab_switcher_controller_egtest.mm

Issue 2642193012: Make EarlGrey matchers compliant with Chromium style. (Closed)
Patch Set: build.gn and rebase Created 3 years, 11 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/ui/tab_switcher/tab_switcher_controller_egtest.mm
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller_egtest.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller_egtest.mm
index cfdb551b41be641b5cead2398b319e4a0997e5a5..f1eb8263b2c5fd8bd3931822e5b245824634a654 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller_egtest.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller_egtest.mm
@@ -21,48 +21,48 @@
#import "ios/chrome/test/earl_grey/chrome_test_case.h"
#include "ui/base/l10n/l10n_util.h"
-using chrome_test_util::buttonWithAccessibilityLabel;
-using chrome_test_util::buttonWithAccessibilityLabelId;
-using chrome_test_util::staticTextWithAccessibilityLabelId;
+using chrome_test_util::ButtonWithAccessibilityLabel;
+using chrome_test_util::ButtonWithAccessibilityLabelId;
+using chrome_test_util::StaticTextWithAccessibilityLabelId;
namespace {
// Returns the GREYMatcher for the button that closes the tab switcher.
-id<GREYMatcher> tabSwitcherCloseButton() {
- return buttonWithAccessibilityLabelId(IDS_IOS_TAB_STRIP_LEAVE_TAB_SWITCHER);
+id<GREYMatcher> TabSwitcherCloseButton() {
+ return ButtonWithAccessibilityLabelId(IDS_IOS_TAB_STRIP_LEAVE_TAB_SWITCHER);
}
// Returns the GREYMatcher for the button that creates new non incognito tabs
// from within the tab switcher.
-id<GREYMatcher> tabSwitcherNewTabButton() {
+id<GREYMatcher> TabSwitcherNewTabButton() {
return grey_allOf(
- buttonWithAccessibilityLabelId(IDS_IOS_TAB_SWITCHER_CREATE_NEW_TAB),
+ ButtonWithAccessibilityLabelId(IDS_IOS_TAB_SWITCHER_CREATE_NEW_TAB),
grey_sufficientlyVisible(), nil);
}
// Returns the GREYMatcher for the button that creates new incognito tabs from
// within the tab switcher.
-id<GREYMatcher> tabSwitcherNewIncognitoTabButton() {
- return grey_allOf(buttonWithAccessibilityLabelId(
+id<GREYMatcher> TabSwitcherNewIncognitoTabButton() {
+ return grey_allOf(ButtonWithAccessibilityLabelId(
IDS_IOS_TAB_SWITCHER_CREATE_NEW_INCOGNITO_TAB),
grey_sufficientlyVisible(), nil);
}
// Returns the GREYMatcher for the button to go to the non incognito panel in
// the tab switcher.
-id<GREYMatcher> tabSwitcherHeaderPanelButton() {
+id<GREYMatcher> TabSwitcherHeaderPanelButton() {
NSString* accessibility_label = l10n_util::GetNSStringWithFixup(
IDS_IOS_TAB_SWITCHER_HEADER_NON_INCOGNITO_TABS);
return grey_accessibilityLabel(accessibility_label);
}
// Returns the GREYMatcher for the button that closes tabs on iPad.
-id<GREYMatcher> closeTabButton() {
- return buttonWithAccessibilityLabelId(IDS_IOS_TOOLS_MENU_CLOSE_TAB);
+id<GREYMatcher> CloseTabButton() {
+ return ButtonWithAccessibilityLabelId(IDS_IOS_TOOLS_MENU_CLOSE_TAB);
}
// Opens a new incognito tabs using the tools menu.
-void openNewIncognitoTabUsingUI() {
+void OpenNewIncognitoTabUsingUI() {
[ChromeEarlGreyUI openToolsMenu];
id<GREYMatcher> newIncognitoTabButtonMatcher =
grey_accessibilityID(kToolsMenuNewIncognitoTabId);
@@ -72,7 +72,7 @@ void openNewIncognitoTabUsingUI() {
// Triggers the opening of the tab switcher by launching a command. Should be
// called only when the tab switcher is not presented.
-void enterTabSwitcherWithCommand() {
+void EnterTabSwitcherWithCommand() {
base::scoped_nsobject<GenericChromeCommand> command(
[[GenericChromeCommand alloc] initWithTag:IDC_TOGGLE_TAB_SWITCHER]);
chrome_test_util::RunCommandWithActiveViewController(command);
@@ -113,7 +113,7 @@ void enterTabSwitcherWithCommand() {
// Checks that the text associated with |messageId| is somewhere on screen.
- (void)assertMessageIsVisible:(int)messageId {
id<GREYMatcher> messageMatcher =
- grey_allOf(staticTextWithAccessibilityLabelId(messageId),
+ grey_allOf(StaticTextWithAccessibilityLabelId(messageId),
grey_sufficientlyVisible(), nil);
[[EarlGrey selectElementWithMatcher:messageMatcher]
assertWithMatcher:grey_notNil()];
@@ -122,7 +122,7 @@ void enterTabSwitcherWithCommand() {
// Checks that the text associated with |messageId| is not visible.
- (void)assertMessageIsNotVisible:(int)messageId {
id<GREYMatcher> messageMatcher =
- grey_allOf(staticTextWithAccessibilityLabelId(messageId),
+ grey_allOf(StaticTextWithAccessibilityLabelId(messageId),
grey_sufficientlyVisible(), nil);
[[EarlGrey selectElementWithMatcher:messageMatcher]
assertWithMatcher:grey_nil()];
@@ -135,7 +135,7 @@ void enterTabSwitcherWithCommand() {
[self assertTabSwitcherIsInactive];
- enterTabSwitcherWithCommand();
+ EnterTabSwitcherWithCommand();
[self assertTabSwitcherIsActive];
// Check that the "No Open Tabs" message is not displayed.
@@ -143,7 +143,7 @@ void enterTabSwitcherWithCommand() {
IDS_IOS_TAB_SWITCHER_NO_LOCAL_NON_INCOGNITO_TABS_TITLE];
// Press the :: icon to exit the tab switcher.
- [[EarlGrey selectElementWithMatcher:tabSwitcherCloseButton()]
+ [[EarlGrey selectElementWithMatcher:TabSwitcherCloseButton()]
performAction:grey_tap()];
[self assertTabSwitcherIsInactive];
@@ -158,7 +158,7 @@ void enterTabSwitcherWithCommand() {
[self assertTabSwitcherIsInactive];
// Close the tab.
- [[EarlGrey selectElementWithMatcher:closeTabButton()]
+ [[EarlGrey selectElementWithMatcher:CloseTabButton()]
performAction:grey_tap()];
[self assertTabSwitcherIsActive];
@@ -168,7 +168,7 @@ void enterTabSwitcherWithCommand() {
IDS_IOS_TAB_SWITCHER_NO_LOCAL_NON_INCOGNITO_TABS_TITLE];
// Create a new tab.
- [[EarlGrey selectElementWithMatcher:tabSwitcherNewTabButton()]
+ [[EarlGrey selectElementWithMatcher:TabSwitcherNewTabButton()]
performAction:grey_tap()];
[self assertTabSwitcherIsInactive];
@@ -182,11 +182,11 @@ void enterTabSwitcherWithCommand() {
[self assertTabSwitcherIsInactive];
// Create new incognito tab from tools menu.
- openNewIncognitoTabUsingUI();
+ OpenNewIncognitoTabUsingUI();
// Close the incognito tab and check that the we are entering the tab
// switcher.
- [[EarlGrey selectElementWithMatcher:closeTabButton()]
+ [[EarlGrey selectElementWithMatcher:CloseTabButton()]
performAction:grey_tap()];
[self assertTabSwitcherIsActive];
@@ -195,23 +195,23 @@ void enterTabSwitcherWithCommand() {
IDS_IOS_TAB_SWITCHER_NO_LOCAL_INCOGNITO_TABS_PROMO];
// Create new incognito tab.
- [[EarlGrey selectElementWithMatcher:tabSwitcherNewIncognitoTabButton()]
+ [[EarlGrey selectElementWithMatcher:TabSwitcherNewIncognitoTabButton()]
performAction:grey_tap()];
// Verify that we've left the tab switcher.
[self assertTabSwitcherIsInactive];
// Close tab and verify we've entered the tab switcher again.
- [[EarlGrey selectElementWithMatcher:closeTabButton()]
+ [[EarlGrey selectElementWithMatcher:CloseTabButton()]
performAction:grey_tap()];
[self assertTabSwitcherIsActive];
// Switch to the non incognito panel.
- [[EarlGrey selectElementWithMatcher:tabSwitcherHeaderPanelButton()]
+ [[EarlGrey selectElementWithMatcher:TabSwitcherHeaderPanelButton()]
performAction:grey_tap()];
// Press the :: icon to exit the tab switcher.
- [[EarlGrey selectElementWithMatcher:tabSwitcherCloseButton()]
+ [[EarlGrey selectElementWithMatcher:TabSwitcherCloseButton()]
performAction:grey_tap()];
// Verify that we've left the tab switcher.
« no previous file with comments | « ios/chrome/browser/ui/sync/sync_fake_server_egtest.mm ('k') | ios/chrome/browser/ui/toolbar/toolbar_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698