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/chrome/test/earl_grey/chrome_earl_grey_ui.h" | 5 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" |
6 | 6 |
7 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" | 7 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" |
8 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 8 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
9 #import "ios/chrome/test/app/chrome_test_util.h" | 9 #import "ios/chrome/test/app/chrome_test_util.h" |
10 #include "ios/chrome/test/app/navigation_test_util.h" | 10 #include "ios/chrome/test/app/navigation_test_util.h" |
11 #import "ios/chrome/test/earl_grey/chrome_matchers.h" | 11 #import "ios/chrome/test/earl_grey/chrome_matchers.h" |
12 #import "ios/testing/wait_util.h" | 12 #import "ios/testing/wait_util.h" |
13 #import "ios/web/public/test/earl_grey/js_test_util.h" | 13 #import "ios/web/public/test/earl_grey/js_test_util.h" |
14 #import "ios/web/public/test/earl_grey/web_view_matchers.h" | 14 #import "ios/web/public/test/earl_grey/web_view_matchers.h" |
15 | 15 |
| 16 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 17 #error "This file requires ARC support." |
| 18 #endif |
| 19 |
16 using testing::WaitUntilConditionOrTimeout; | 20 using testing::WaitUntilConditionOrTimeout; |
17 using testing::kWaitForPageLoadTimeout; | 21 using testing::kWaitForPageLoadTimeout; |
18 | 22 |
19 @implementation ChromeEarlGreyUI | 23 @implementation ChromeEarlGreyUI |
20 | 24 |
21 + (void)openToolsMenu { | 25 + (void)openToolsMenu { |
22 // TODO(crbug.com/685570): Fix the tap instead of adding a delay. | 26 // TODO(crbug.com/685570): Fix the tap instead of adding a delay. |
23 GREYCondition* myCondition = [GREYCondition | 27 GREYCondition* myCondition = [GREYCondition |
24 conditionWithName:@"Delay to ensure the toolbar menu can be opened" | 28 conditionWithName:@"Delay to ensure the toolbar menu can be opened" |
25 block:^BOOL { | 29 block:^BOOL { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 73 |
70 + (void)openShareMenu { | 74 + (void)openShareMenu { |
71 if (IsCompact()) { | 75 if (IsCompact()) { |
72 [ChromeEarlGreyUI openToolsMenu]; | 76 [ChromeEarlGreyUI openToolsMenu]; |
73 } | 77 } |
74 [[EarlGrey selectElementWithMatcher:chrome_test_util::ShareButton()] | 78 [[EarlGrey selectElementWithMatcher:chrome_test_util::ShareButton()] |
75 performAction:grey_tap()]; | 79 performAction:grey_tap()]; |
76 } | 80 } |
77 | 81 |
78 @end | 82 @end |
OLD | NEW |