| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <EarlGrey/EarlGrey.h> | 5 #import <EarlGrey/EarlGrey.h> |
| 6 #import <UIKit/UIKit.h> | 6 #import <UIKit/UIKit.h> |
| 7 #import <XCTest/XCTest.h> | 7 #import <XCTest/XCTest.h> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 return ButtonWithAccessibilityLabelId(IDS_IOS_CLEAR_BROWSING_DATA_TITLE); | 124 return ButtonWithAccessibilityLabelId(IDS_IOS_CLEAR_BROWSING_DATA_TITLE); |
| 125 } | 125 } |
| 126 // Matcher for the Search Engine cell on the main Settings screen. | 126 // Matcher for the Search Engine cell on the main Settings screen. |
| 127 id<GREYMatcher> SearchEngineButton() { | 127 id<GREYMatcher> SearchEngineButton() { |
| 128 return ButtonWithAccessibilityLabelId(IDS_IOS_SEARCH_ENGINE_SETTING_TITLE); | 128 return ButtonWithAccessibilityLabelId(IDS_IOS_SEARCH_ENGINE_SETTING_TITLE); |
| 129 } | 129 } |
| 130 // Matcher for the Autofill Forms cell on the main Settings screen. | 130 // Matcher for the Autofill Forms cell on the main Settings screen. |
| 131 id<GREYMatcher> AutofillButton() { | 131 id<GREYMatcher> AutofillButton() { |
| 132 return ButtonWithAccessibilityLabelId(IDS_IOS_AUTOFILL); | 132 return ButtonWithAccessibilityLabelId(IDS_IOS_AUTOFILL); |
| 133 } | 133 } |
| 134 // Matcher for the Google Apps cell on the main Settings screen. |
| 135 id<GREYMatcher> GoogleAppsButton() { |
| 136 return ButtonWithAccessibilityLabelId(IDS_IOS_GOOGLE_APPS_SM_SETTINGS); |
| 137 } |
| 134 // Matcher for the Google Chrome cell on the main Settings screen. | 138 // Matcher for the Google Chrome cell on the main Settings screen. |
| 135 id<GREYMatcher> GoogleChromeButton() { | 139 id<GREYMatcher> GoogleChromeButton() { |
| 136 return ButtonWithAccessibilityLabelId(IDS_IOS_PRODUCT_NAME); | 140 return ButtonWithAccessibilityLabelId(IDS_IOS_PRODUCT_NAME); |
| 137 } | 141 } |
| 138 // Matcher for the Google Chrome cell on the main Settings screen. | 142 // Matcher for the Google Chrome cell on the main Settings screen. |
| 139 id<GREYMatcher> VoiceSearchButton() { | 143 id<GREYMatcher> VoiceSearchButton() { |
| 140 return grey_allOf(grey_accessibilityID(kSettingsVoiceSearchCellId), | 144 return grey_allOf(grey_accessibilityID(kSettingsVoiceSearchCellId), |
| 141 grey_accessibilityTrait(UIAccessibilityTraitButton), nil); | 145 grey_accessibilityTrait(UIAccessibilityTraitButton), nil); |
| 142 } | 146 } |
| 143 // Matcher for the Preload Webpages button on the bandwidth UI. | 147 // Matcher for the Preload Webpages button on the bandwidth UI. |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 - (void)testAccessibilityOnAutofillForms { | 903 - (void)testAccessibilityOnAutofillForms { |
| 900 [ChromeEarlGreyUI openToolsMenu]; | 904 [ChromeEarlGreyUI openToolsMenu]; |
| 901 [[EarlGrey selectElementWithMatcher:SettingsButton()] | 905 [[EarlGrey selectElementWithMatcher:SettingsButton()] |
| 902 performAction:grey_tap()]; | 906 performAction:grey_tap()]; |
| 903 [[EarlGrey selectElementWithMatcher:AutofillButton()] | 907 [[EarlGrey selectElementWithMatcher:AutofillButton()] |
| 904 performAction:grey_tap()]; | 908 performAction:grey_tap()]; |
| 905 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 909 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
| 906 [self closeSubSettingsMenu]; | 910 [self closeSubSettingsMenu]; |
| 907 } | 911 } |
| 908 | 912 |
| 913 // Verifies the UI elements are accessible on the Google Apps page. |
| 914 - (void)testAccessibilityOnGoogleApps { |
| 915 [ChromeEarlGreyUI openToolsMenu]; |
| 916 [[EarlGrey selectElementWithMatcher:SettingsButton()] |
| 917 performAction:grey_tap()]; |
| 918 [[EarlGrey selectElementWithMatcher:GoogleAppsButton()] |
| 919 performAction:grey_tap()]; |
| 920 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
| 921 [self closeSubSettingsMenu]; |
| 922 } |
| 923 |
| 909 // Verifies the UI elements are accessible on the About Chrome page. | 924 // Verifies the UI elements are accessible on the About Chrome page. |
| 910 - (void)testAccessibilityOnGoogleChrome { | 925 - (void)testAccessibilityOnGoogleChrome { |
| 911 [self openSubSettingMenu:GoogleChromeButton()]; | 926 [self openSubSettingMenu:GoogleChromeButton()]; |
| 912 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 927 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
| 913 [self closeSubSettingsMenu]; | 928 [self closeSubSettingsMenu]; |
| 914 } | 929 } |
| 915 | 930 |
| 916 // Verifies the UI elements are accessible on the Voice Search page. | 931 // Verifies the UI elements are accessible on the Voice Search page. |
| 917 - (void)testAccessibilityOnVoiceSearch { | 932 - (void)testAccessibilityOnVoiceSearch { |
| 918 [self openSubSettingMenu:VoiceSearchButton()]; | 933 [self openSubSettingMenu:VoiceSearchButton()]; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 performAction:grey_tap()]; | 1031 performAction:grey_tap()]; |
| 1017 [[EarlGrey selectElementWithMatcher:PrivacyButton()] | 1032 [[EarlGrey selectElementWithMatcher:PrivacyButton()] |
| 1018 performAction:grey_tap()]; | 1033 performAction:grey_tap()]; |
| 1019 [[EarlGrey selectElementWithMatcher:SendUsageDataButton()] | 1034 [[EarlGrey selectElementWithMatcher:SendUsageDataButton()] |
| 1020 performAction:grey_tap()]; | 1035 performAction:grey_tap()]; |
| 1021 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 1036 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
| 1022 [self closeSubSettingsMenu]; | 1037 [self closeSubSettingsMenu]; |
| 1023 } | 1038 } |
| 1024 | 1039 |
| 1025 @end | 1040 @end |
| OLD | NEW |