OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_ACTIONS_H_ |
| 6 #define IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_ACTIONS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #import <EarlGrey/EarlGrey.h> |
| 11 |
| 12 #import "ios/web/public/web_state/web_state.h" |
| 13 |
| 14 namespace web { |
| 15 |
| 16 // Action wrapper that performs |action| on the webview of |state|. |
| 17 // The action will fail (in addition to its own failure modes) if |element_id| |
| 18 // can't be located, or if it doesn't trigger a mousedown event on |element_id| |
| 19 // inside the webview. |
| 20 id<GREYAction> webViewVerifiedActionOnElement(WebState* state, |
| 21 id<GREYAction> action, |
| 22 const std::string& element_id); |
| 23 |
| 24 // Executes a longpress on element |element_id| in the webview of |
| 25 // |state|. If |triggers_context_menu| is true, this gesture is expected to |
| 26 // cause the context menu to appear, and is not expected to trigger events |
| 27 // in the webview. If |triggers_context_menu| is false, the converse is true. |
| 28 // This action doesn't fail if the context menu isn't displayed; calling code |
| 29 // should check for that separately with a matcher. |
| 30 id<GREYAction> webViewLongPressElementForContextMenu( |
| 31 WebState* state, |
| 32 const std::string& element_id, |
| 33 bool triggers_context_menu); |
| 34 |
| 35 } // namespace web |
| 36 |
| 37 #endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_ACTIONS_H_ |
OLD | NEW |