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

Unified Diff: ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_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/ntp/recent_tabs/recent_tabs_panel_controller_egtest.mm
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_controller_egtest.mm b/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_controller_egtest.mm
index 3b0db053980be8741451265b7f2bb1f135f47ad0..2ef4965bd5c95d4246108ef6536e3bf6050c3411 100644
--- a/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_controller_egtest.mm
+++ b/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_controller_egtest.mm
@@ -49,20 +49,15 @@ void CloseRecentTabsPanelOnIphone() {
}
// Returns the matcher for the entry of the page in the recent tabs panel.
-id<GREYMatcher> titleOfTestPageMatcher() {
+id<GREYMatcher> TitleOfTestPage() {
return grey_allOf(
- chrome_test_util::staticTextWithAccessibilityLabel(kTitleOfTestPage),
+ chrome_test_util::StaticTextWithAccessibilityLabel(kTitleOfTestPage),
grey_sufficientlyVisible(), nil);
}
-// Returns the matcher for the back button.
-id<GREYMatcher> backButtonMatcher() {
- return chrome_test_util::buttonWithAccessibilityLabelId(IDS_ACCNAME_BACK);
-}
-
// Returns the matcher for the Recently closed label.
-id<GREYMatcher> recentlyClosedLabelMatcher() {
- return chrome_test_util::staticTextWithAccessibilityLabelId(
+id<GREYMatcher> RecentlyClosedLabelMatcher() {
+ return chrome_test_util::StaticTextWithAccessibilityLabelId(
IDS_IOS_RECENT_TABS_RECENTLY_CLOSED);
}
@@ -87,14 +82,14 @@ id<GREYMatcher> recentlyClosedLabelMatcher() {
if (IsIPadIdiom()) {
chrome_test_util::OpenNewTab();
NSError* error = nil;
- [[EarlGrey selectElementWithMatcher:recentlyClosedLabelMatcher()]
+ [[EarlGrey selectElementWithMatcher:RecentlyClosedLabelMatcher()]
assertWithMatcher:grey_notNil()
error:&error];
// If the Recent Tabs panel is shown, then switch back to the Most Visited
// panel so that tabs opened in other tests will show the Most Visited panel
// instead of the Recent Tabs panel.
if (!error) {
- [[EarlGrey selectElementWithMatcher:recentlyClosedLabelMatcher()]
+ [[EarlGrey selectElementWithMatcher:RecentlyClosedLabelMatcher()]
performAction:grey_swipeFastInDirection(kGREYDirectionRight)];
}
chrome_test_util::CloseCurrentTab();
@@ -109,21 +104,21 @@ id<GREYMatcher> recentlyClosedLabelMatcher() {
// Open the test page in a new tab.
[ChromeEarlGrey loadURL:testPageURL];
id<GREYMatcher> webViewMatcher =
- chrome_test_util::webViewContainingText("hello");
+ chrome_test_util::WebViewContainingText("hello");
[[EarlGrey selectElementWithMatcher:webViewMatcher]
assertWithMatcher:grey_notNil()];
// Open the Recent Tabs panel, check that the test page is not
// present.
OpenRecentTabsPanel();
- [[EarlGrey selectElementWithMatcher:titleOfTestPageMatcher()]
+ [[EarlGrey selectElementWithMatcher:TitleOfTestPage()]
assertWithMatcher:grey_nil()];
// Get rid of the Recent Tabs Panel.
if (IsIPadIdiom()) {
// On iPad, the Recent Tabs panel is a new page in the navigation history.
// Go back to the previous page to restore the test page.
- [[EarlGrey selectElementWithMatcher:backButtonMatcher()]
+ [[EarlGrey selectElementWithMatcher:chrome_test_util::BackButton()]
performAction:grey_tap()];
[ChromeEarlGrey waitForPageToFinishLoading];
} else {
@@ -139,15 +134,15 @@ id<GREYMatcher> recentlyClosedLabelMatcher() {
// Open the Recent Tabs panel and check that the test page is present.
OpenRecentTabsPanel();
- [[EarlGrey selectElementWithMatcher:titleOfTestPageMatcher()]
+ [[EarlGrey selectElementWithMatcher:TitleOfTestPage()]
assertWithMatcher:grey_notNil()];
// Tap on the entry for the test page in the Recent Tabs panel and check that
// a tab containing the test page was opened.
- [[EarlGrey selectElementWithMatcher:titleOfTestPageMatcher()]
+ [[EarlGrey selectElementWithMatcher:TitleOfTestPage()]
performAction:grey_tap()];
- [[EarlGrey selectElementWithMatcher:chrome_test_util::omnibox()]
- assertWithMatcher:chrome_test_util::omniboxText(
+ [[EarlGrey selectElementWithMatcher:chrome_test_util::Omnibox()]
+ assertWithMatcher:chrome_test_util::OmniboxText(
testPageURL.GetContent())];
}
« no previous file with comments | « ios/chrome/browser/ui/keyboard_commands_egtest.mm ('k') | ios/chrome/browser/ui/print/print_controller_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698