| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 kTestOrigin1, &dummy_key, base::Bind(CertCallback)); | 259 kTestOrigin1, &dummy_key, base::Bind(CertCallback)); |
| 260 dispatch_semaphore_signal(semaphore); | 260 dispatch_semaphore_signal(semaphore); |
| 261 })); | 261 })); |
| 262 dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | 262 dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); |
| 263 dispatch_release(semaphore); | 263 dispatch_release(semaphore); |
| 264 return result == net::ERR_FILE_NOT_FOUND; | 264 return result == net::ERR_FILE_NOT_FOUND; |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace | 267 } // namespace |
| 268 | 268 |
| 269 // Expose the first responder. |
| 270 @interface UIWindow (FirstResponder) |
| 271 - (UIResponder*)firstResponder; |
| 272 @end |
| 273 |
| 269 // Settings tests for Chrome. | 274 // Settings tests for Chrome. |
| 270 @interface SettingsTestCase : ChromeTestCase | 275 @interface SettingsTestCase : ChromeTestCase |
| 271 @end | 276 @end |
| 272 | 277 |
| 273 @implementation SettingsTestCase | 278 @implementation SettingsTestCase |
| 274 | 279 |
| 275 // Opens the a submenu from the settings page. Must be called from the NTP. | 280 // Opens the a submenu from the settings page. Must be called from the NTP. |
| 276 // TODO(crbug.com/684619): Investigate why usingSearchAction doesn't scroll | 281 // TODO(crbug.com/684619): Investigate why usingSearchAction doesn't scroll |
| 277 // until the bottom. | 282 // until the bottom. |
| 278 - (void)openSubSettingMenu:(id<GREYMatcher>)settingToTap { | 283 - (void)openSubSettingMenu:(id<GREYMatcher>)settingToTap { |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 - (void)testAccessibilityOnPasswords { | 952 - (void)testAccessibilityOnPasswords { |
| 948 [ChromeEarlGreyUI openToolsMenu]; | 953 [ChromeEarlGreyUI openToolsMenu]; |
| 949 [[EarlGrey selectElementWithMatcher:SettingsButton()] | 954 [[EarlGrey selectElementWithMatcher:SettingsButton()] |
| 950 performAction:grey_tap()]; | 955 performAction:grey_tap()]; |
| 951 [[EarlGrey selectElementWithMatcher:PasswordsButton()] | 956 [[EarlGrey selectElementWithMatcher:PasswordsButton()] |
| 952 performAction:grey_tap()]; | 957 performAction:grey_tap()]; |
| 953 chrome_test_util::VerifyAccessibilityForCurrentScreen(); | 958 chrome_test_util::VerifyAccessibilityForCurrentScreen(); |
| 954 [self closeSubSettingsMenu]; | 959 [self closeSubSettingsMenu]; |
| 955 } | 960 } |
| 956 | 961 |
| 962 // Tests that hitting the tab key doesn't trigger the omnibox in the background. |
| 963 // Testing against regressions of the fix for crbug.com/676993. |
| 964 - (void)testTabKeyIsANoOp { |
| 965 // Open Settings. |
| 966 [ChromeEarlGreyUI openToolsMenu]; |
| 967 [[EarlGrey selectElementWithMatcher:SettingsButton()] |
| 968 performAction:grey_tap()]; |
| 969 |
| 970 // Hit the tab key. |
| 971 // TODO(crbug.com/695876): Simulate a tab key press with EalrGrey. |
| 972 |
| 973 // Verify that the omnibox is not focused. |
| 974 GREYAssertFalse([[[[UIApplication sharedApplication] keyWindow] |
| 975 firstResponder] isKindOfClass:[UITextField class]]); |
| 976 } |
| 977 |
| 957 @end | 978 @end |
| OLD | NEW |