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

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

Issue 2275303004: Context menu egtests, plus related utilities. (Closed)
Patch Set: Reviewable. 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
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..648d64f6be0c771fb35cf0ce3db972e3c2be22dc
--- /dev/null
+++ b/ios/web/public/test/earl_grey/web_view_actions.h
@@ -0,0 +1,36 @@
+// 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_
+
+#import <string>
Eugene But (OOO till 7-30) 2016/08/30 18:11:04 s/import/include
marq (ping after 24h) 2016/08/31 13:07:57 Done.
+
+#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,
+ std::string element_id);
Eugene But (OOO till 7-30) 2016/08/30 18:11:04 const std::string& ?
marq (ping after 24h) 2016/08/31 13:07:57 Done.
+
+// 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.
+void LongPressWebViewElementForContextMenu(WebState* state,
Eugene But (OOO till 7-30) 2016/08/30 18:11:04 Is there a reason why this is not inside web_view_
marq (ping after 24h) 2016/08/31 13:07:57 Yeah, the problem is that web_view_interaction_tes
+ std::string element_id,
+ bool triggers_context_menu);
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_ACTIONS_H_

Powered by Google App Engine
This is Rietveld 408576698