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

Unified Diff: ios/web/public/test/web_view_interaction_test_util.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/web_view_interaction_test_util.h
diff --git a/ios/web/public/test/web_view_interaction_test_util.h b/ios/web/public/test/web_view_interaction_test_util.h
index 2981ecc42ce7e6430710b4ad00cbf99b07a8fb6d..d75de7d70f8b1c57c0785574fa0ac501e0ba481a 100644
--- a/ios/web/public/test/web_view_interaction_test_util.h
+++ b/ios/web/public/test/web_view_interaction_test_util.h
@@ -2,13 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "ios/web/public/web_state/web_state.h"
+#import <UIKit/UIKit.h>
#include <string>
+#include "base/ios/block_types.h"
+#include "base/values.h"
+
+#import "ios/web/public/web_state/web_state.h"
+
namespace web {
namespace test {
+// Synchronously returns the result of executed JavaScript.
+std::unique_ptr<base::Value> ExecuteScript(web::WebState* web_state,
Eugene But (OOO till 7-30) 2016/08/30 18:11:05 s/ExecuteScript/ExecuteJavaScript to be consistent
marq (ping after 24h) 2016/08/31 13:07:58 Done.
+ const std::string& script);
+
+// Returns the CGRect, in the coordinate system of web_state's view, that
+// encloses the element with |element_id| in |web_state|'s webview.
+// There is no guarantee that the CGRect returned is inside the current window;
+// callers should check and act accordingly (scrolling the webview, perhaps).
+// Returns CGRectZero if no element could be found.
+CGRect BoundingRectOfElementWithId(web::WebState* web_state,
Eugene But (OOO till 7-30) 2016/08/30 18:11:05 Maybe s/BoundingRectOfElementWithId/GetBoundingEle
marq (ping after 24h) 2016/08/31 13:07:58 Yeah, I can write Objective-C in any language.
+ const std::string& element_id);
+
// Returns whether the element with |element_id| in the passed |web_state| has
// been tapped using a JavaScript click() event.
bool TapWebViewElementWithId(web::WebState* web_state,

Powered by Google App Engine
This is Rietveld 408576698