Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: ios/web/public/test/earl_grey/web_view_actions.h

Issue 2275303004: Context menu egtests, plus related utilities. (Closed)
Patch Set: Fewer References. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/public/test/earl_grey/web_view_actions.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/earl_grey/web_view_actions.h
diff --git a/ios/web/public/test/earl_grey/web_view_actions.h b/ios/web/public/test/earl_grey/web_view_actions.h
new file mode 100644
index 0000000000000000000000000000000000000000..779a10d1e0fec6fafd0dc594e711701197039774
--- /dev/null
+++ b/ios/web/public/test/earl_grey/web_view_actions.h
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_ACTIONS_H_
+#define IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_ACTIONS_H_
+
+#include <string>
+
+#import <EarlGrey/EarlGrey.h>
+
+#import "ios/web/public/web_state/web_state.h"
+
+namespace web {
+
+// Action wrapper that performs |action| on the webview of |state|.
+// The action will fail (in addition to its own failure modes) if |element_id|
+// can't be located, or if it doesn't trigger a mousedown event on |element_id|
+// inside the webview.
+id<GREYAction> webViewVerifiedActionOnElement(WebState* state,
+ id<GREYAction> action,
+ const std::string& element_id);
+
+// Executes a longpress on element |element_id| in the webview of
+// |state|. If |triggers_context_menu| is true, this gesture is expected to
+// cause the context menu to appear, and is not expected to trigger events
+// in the webview. If |triggers_context_menu| is false, the converse is true.
+// This action doesn't fail if the context menu isn't displayed; calling code
+// should check for that separately with a matcher.
+id<GREYAction> webViewLongPressElementForContextMenu(
+ WebState* state,
+ const std::string& element_id,
+ bool triggers_context_menu);
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_ACTIONS_H_
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/public/test/earl_grey/web_view_actions.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698