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_actions.h" | 5 #import "ios/chrome/test/earl_grey/chrome_actions.h" |
6 | 6 |
7 #import "base/mac/foundation_util.h" | 7 #import "base/mac/foundation_util.h" |
8 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_switch_item
.h" | 8 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_switch_item
.h" |
9 #import "ios/chrome/test/app/chrome_test_util.h" | 9 #import "ios/chrome/test/app/chrome_test_util.h" |
10 #import "ios/web/public/test/earl_grey/web_view_actions.h" | 10 #import "ios/web/public/test/earl_grey/web_view_actions.h" |
11 | 11 |
| 12 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 13 #error "This file requires ARC support." |
| 14 #endif |
| 15 |
12 namespace chrome_test_util { | 16 namespace chrome_test_util { |
13 | 17 |
14 id<GREYAction> longPressElementForContextMenu(const std::string& element_id, | 18 id<GREYAction> longPressElementForContextMenu(const std::string& element_id, |
15 bool triggers_context_menu) { | 19 bool triggers_context_menu) { |
16 return webViewLongPressElementForContextMenu( | 20 return webViewLongPressElementForContextMenu( |
17 chrome_test_util::GetCurrentWebState(), element_id, | 21 chrome_test_util::GetCurrentWebState(), element_id, |
18 triggers_context_menu); | 22 triggers_context_menu); |
19 } | 23 } |
20 | 24 |
21 id<GREYAction> turnCollectionViewSwitchOn(BOOL on) { | 25 id<GREYAction> turnCollectionViewSwitchOn(BOOL on) { |
(...skipping 13 matching lines...) Expand all Loading... |
35 if (switchView.on ^ on) { | 39 if (switchView.on ^ on) { |
36 id<GREYAction> longPressAction = [GREYActions | 40 id<GREYAction> longPressAction = [GREYActions |
37 actionForLongPressWithDuration:kGREYLongPressDefaultDuration]; | 41 actionForLongPressWithDuration:kGREYLongPressDefaultDuration]; |
38 return [longPressAction perform:switchView error:errorOrNil]; | 42 return [longPressAction perform:switchView error:errorOrNil]; |
39 } | 43 } |
40 return YES; | 44 return YES; |
41 }]; | 45 }]; |
42 } | 46 } |
43 | 47 |
44 } // namespace chrome_test_util | 48 } // namespace chrome_test_util |
OLD | NEW |