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" |
11 #import "base/mac/bind_objc_block.h" | 11 #import "base/mac/bind_objc_block.h" |
12 #include "base/mac/foundation_util.h" | 12 #include "base/mac/foundation_util.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/strings/sys_string_conversions.h" | 14 #include "base/strings/sys_string_conversions.h" |
15 #include "components/browsing_data/core/pref_names.h" | 15 #include "components/browsing_data/core/pref_names.h" |
16 #include "components/metrics/metrics_pref_names.h" | 16 #include "components/metrics/metrics_pref_names.h" |
17 #include "components/password_manager/core/common/password_manager_pref_names.h" | 17 #include "components/password_manager/core/common/password_manager_pref_names.h" |
18 #include "components/prefs/pref_member.h" | 18 #include "components/prefs/pref_member.h" |
19 #include "components/prefs/pref_service.h" | 19 #include "components/prefs/pref_service.h" |
20 #include "components/strings/grit/components_strings.h" | 20 #include "components/strings/grit/components_strings.h" |
21 #import "ios/chrome/app/main_controller.h" | 21 #import "ios/chrome/app/main_controller.h" |
22 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 22 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
23 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.
h" | 23 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.
h" |
| 24 #include "ios/chrome/browser/experimental_flags.h" |
24 #include "ios/chrome/browser/pref_names.h" | 25 #include "ios/chrome/browser/pref_names.h" |
25 #import "ios/chrome/browser/ui/browser_view_controller.h" | 26 #import "ios/chrome/browser/ui/browser_view_controller.h" |
26 #import "ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_cont
roller.h" | 27 #import "ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_cont
roller.h" |
27 #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" | 28 #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" |
28 #include "ios/chrome/browser/ui/tools_menu/tools_menu_constants.h" | 29 #include "ios/chrome/browser/ui/tools_menu/tools_menu_constants.h" |
29 #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" | 30 #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" |
30 #include "ios/chrome/grit/ios_chromium_strings.h" | 31 #include "ios/chrome/grit/ios_chromium_strings.h" |
31 #include "ios/chrome/grit/ios_strings.h" | 32 #include "ios/chrome/grit/ios_strings.h" |
32 #include "ios/chrome/grit/ios_theme_resources.h" | 33 #include "ios/chrome/grit/ios_theme_resources.h" |
33 #import "ios/chrome/test/app/chrome_test_util.h" | 34 #import "ios/chrome/test/app/chrome_test_util.h" |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 [[EarlGrey selectElementWithMatcher:SettingsButton()] | 906 [[EarlGrey selectElementWithMatcher:SettingsButton()] |
906 performAction:grey_tap()]; | 907 performAction:grey_tap()]; |
907 [[EarlGrey selectElementWithMatcher:AutofillButton()] | 908 [[EarlGrey selectElementWithMatcher:AutofillButton()] |
908 performAction:grey_tap()]; | 909 performAction:grey_tap()]; |
909 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 910 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
910 [self closeSubSettingsMenu]; | 911 [self closeSubSettingsMenu]; |
911 } | 912 } |
912 | 913 |
913 // Verifies the UI elements are accessible on the Google Apps page. | 914 // Verifies the UI elements are accessible on the Google Apps page. |
914 - (void)testAccessibilityOnGoogleApps { | 915 - (void)testAccessibilityOnGoogleApps { |
| 916 // TODO(crbug/711511): Remove when Native App Launcher is full deprecated. |
| 917 if (!experimental_flags::IsNativeAppLauncherEnabled()) |
| 918 return; |
915 [ChromeEarlGreyUI openToolsMenu]; | 919 [ChromeEarlGreyUI openToolsMenu]; |
916 [[EarlGrey selectElementWithMatcher:SettingsButton()] | 920 [[EarlGrey selectElementWithMatcher:SettingsButton()] |
917 performAction:grey_tap()]; | 921 performAction:grey_tap()]; |
918 [[EarlGrey selectElementWithMatcher:GoogleAppsButton()] | 922 [[EarlGrey selectElementWithMatcher:GoogleAppsButton()] |
919 performAction:grey_tap()]; | 923 performAction:grey_tap()]; |
920 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 924 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
921 [self closeSubSettingsMenu]; | 925 [self closeSubSettingsMenu]; |
922 } | 926 } |
923 | 927 |
924 // Verifies the UI elements are accessible on the About Chrome page. | 928 // Verifies the UI elements are accessible on the About Chrome page. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 performAction:grey_tap()]; | 1035 performAction:grey_tap()]; |
1032 [[EarlGrey selectElementWithMatcher:PrivacyButton()] | 1036 [[EarlGrey selectElementWithMatcher:PrivacyButton()] |
1033 performAction:grey_tap()]; | 1037 performAction:grey_tap()]; |
1034 [[EarlGrey selectElementWithMatcher:SendUsageDataButton()] | 1038 [[EarlGrey selectElementWithMatcher:SendUsageDataButton()] |
1035 performAction:grey_tap()]; | 1039 performAction:grey_tap()]; |
1036 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 1040 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
1037 [self closeSubSettingsMenu]; | 1041 [self closeSubSettingsMenu]; |
1038 } | 1042 } |
1039 | 1043 |
1040 @end | 1044 @end |
OLD | NEW |