| 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 } | |
| 138 // Matcher for the Google Chrome cell on the main Settings screen. | 134 // Matcher for the Google Chrome cell on the main Settings screen. |
| 139 id<GREYMatcher> GoogleChromeButton() { | 135 id<GREYMatcher> GoogleChromeButton() { |
| 140 return ButtonWithAccessibilityLabelId(IDS_IOS_PRODUCT_NAME); | 136 return ButtonWithAccessibilityLabelId(IDS_IOS_PRODUCT_NAME); |
| 141 } | 137 } |
| 142 // Matcher for the Google Chrome cell on the main Settings screen. | 138 // Matcher for the Google Chrome cell on the main Settings screen. |
| 143 id<GREYMatcher> VoiceSearchButton() { | 139 id<GREYMatcher> VoiceSearchButton() { |
| 144 return grey_allOf(grey_accessibilityID(kSettingsVoiceSearchCellId), | 140 return grey_allOf(grey_accessibilityID(kSettingsVoiceSearchCellId), |
| 145 grey_accessibilityTrait(UIAccessibilityTraitButton), nil); | 141 grey_accessibilityTrait(UIAccessibilityTraitButton), nil); |
| 146 } | 142 } |
| 147 // Matcher for the Preload Webpages button on the bandwidth UI. | 143 // Matcher for the Preload Webpages button on the bandwidth UI. |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 - (void)testAccessibilityOnAutofillForms { | 899 - (void)testAccessibilityOnAutofillForms { |
| 904 [ChromeEarlGreyUI openToolsMenu]; | 900 [ChromeEarlGreyUI openToolsMenu]; |
| 905 [[EarlGrey selectElementWithMatcher:SettingsButton()] | 901 [[EarlGrey selectElementWithMatcher:SettingsButton()] |
| 906 performAction:grey_tap()]; | 902 performAction:grey_tap()]; |
| 907 [[EarlGrey selectElementWithMatcher:AutofillButton()] | 903 [[EarlGrey selectElementWithMatcher:AutofillButton()] |
| 908 performAction:grey_tap()]; | 904 performAction:grey_tap()]; |
| 909 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 905 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
| 910 [self closeSubSettingsMenu]; | 906 [self closeSubSettingsMenu]; |
| 911 } | 907 } |
| 912 | 908 |
| 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 | |
| 924 // Verifies the UI elements are accessible on the About Chrome page. | 909 // Verifies the UI elements are accessible on the About Chrome page. |
| 925 - (void)testAccessibilityOnGoogleChrome { | 910 - (void)testAccessibilityOnGoogleChrome { |
| 926 [self openSubSettingMenu:GoogleChromeButton()]; | 911 [self openSubSettingMenu:GoogleChromeButton()]; |
| 927 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 912 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
| 928 [self closeSubSettingsMenu]; | 913 [self closeSubSettingsMenu]; |
| 929 } | 914 } |
| 930 | 915 |
| 931 // Verifies the UI elements are accessible on the Voice Search page. | 916 // Verifies the UI elements are accessible on the Voice Search page. |
| 932 - (void)testAccessibilityOnVoiceSearch { | 917 - (void)testAccessibilityOnVoiceSearch { |
| 933 [self openSubSettingMenu:VoiceSearchButton()]; | 918 [self openSubSettingMenu:VoiceSearchButton()]; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 performAction:grey_tap()]; | 1016 performAction:grey_tap()]; |
| 1032 [[EarlGrey selectElementWithMatcher:PrivacyButton()] | 1017 [[EarlGrey selectElementWithMatcher:PrivacyButton()] |
| 1033 performAction:grey_tap()]; | 1018 performAction:grey_tap()]; |
| 1034 [[EarlGrey selectElementWithMatcher:SendUsageDataButton()] | 1019 [[EarlGrey selectElementWithMatcher:SendUsageDataButton()] |
| 1035 performAction:grey_tap()]; | 1020 performAction:grey_tap()]; |
| 1036 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 1021 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
| 1037 [self closeSubSettingsMenu]; | 1022 [self closeSubSettingsMenu]; |
| 1038 } | 1023 } |
| 1039 | 1024 |
| 1040 @end | 1025 @end |
| OLD | NEW |