| 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 "ios/web/shell/test/earl_grey/shell_matchers.h" | 5 #import "ios/web/shell/test/earl_grey/shell_matchers.h" |
| 6 | 6 |
| 7 #import "base/mac/foundation_util.h" | 7 #import "base/mac/foundation_util.h" |
| 8 #include "base/test/ios/wait_util.h" | 8 #include "base/test/ios/wait_util.h" |
| 9 #include "ios/testing/earl_grey/wait_util.h" | 9 #include "ios/testing/earl_grey/wait_util.h" |
| 10 #import "ios/web/public/web_state/web_state.h" | 10 #import "ios/web/public/web_state/web_state.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 if ([textField.text isEqualToString:text]) { | 60 if ([textField.text isEqualToString:text]) { |
| 61 return YES; | 61 return YES; |
| 62 } | 62 } |
| 63 base::test::ios::SpinRunLoopWithMaxDelay( | 63 base::test::ios::SpinRunLoopWithMaxDelay( |
| 64 base::TimeDelta::FromSecondsD(testing::kSpinDelaySeconds)); | 64 base::TimeDelta::FromSecondsD(testing::kSpinDelaySeconds)); |
| 65 } | 65 } |
| 66 return NO; | 66 return NO; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 DescribeToBlock describe = ^(id<GREYDescription> description) { | 69 DescribeToBlock describe = ^(id<GREYDescription> description) { |
| 70 [description appendText:@"web view containing "]; | 70 [description appendText:@"address field containing "]; |
| 71 [description appendText:text]; | 71 [description appendText:text]; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 return [[[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches | 74 return [[[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches |
| 75 descriptionBlock:describe] | 75 descriptionBlock:describe] |
| 76 autorelease]; | 76 autorelease]; |
| 77 } | 77 } |
| 78 | 78 |
| 79 + (id<GREYMatcher>)matcherForWebShellBackButton { | 79 + (id<GREYMatcher>)matcherForWebShellBackButton { |
| 80 return grey_accessibilityLabel(kWebShellBackButtonAccessibilityLabel); | 80 return grey_accessibilityLabel(kWebShellBackButtonAccessibilityLabel); |
| 81 } | 81 } |
| 82 | 82 |
| 83 + (id<GREYMatcher>)matcherForWebShellForwardButton { | 83 + (id<GREYMatcher>)matcherForWebShellForwardButton { |
| 84 return grey_accessibilityLabel(kWebShellForwardButtonAccessibilityLabel); | 84 return grey_accessibilityLabel(kWebShellForwardButtonAccessibilityLabel); |
| 85 } | 85 } |
| 86 | 86 |
| 87 + (id<GREYMatcher>)matcherForWebShellAddressField { | 87 + (id<GREYMatcher>)matcherForWebShellAddressField { |
| 88 return grey_accessibilityLabel(kWebShellAddressFieldAccessibilityLabel); | 88 return grey_accessibilityLabel(kWebShellAddressFieldAccessibilityLabel); |
| 89 } | 89 } |
| 90 | 90 |
| 91 @end | 91 @end |
| OLD | NEW |