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

Side by Side 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, 3 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 unified diff | Download patch
OLDNEW
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/web/public/web_state/web_state.h" 5 #import <UIKit/UIKit.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/ios/block_types.h"
10 #include "base/values.h"
11
12 #import "ios/web/public/web_state/web_state.h"
13
9 namespace web { 14 namespace web {
10 namespace test { 15 namespace test {
11 16
17 // Synchronously returns the result of executed JavaScript.
18 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.
19 const std::string& script);
20
21 // Returns the CGRect, in the coordinate system of web_state's view, that
22 // encloses the element with |element_id| in |web_state|'s webview.
23 // There is no guarantee that the CGRect returned is inside the current window;
24 // callers should check and act accordingly (scrolling the webview, perhaps).
25 // Returns CGRectZero if no element could be found.
26 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.
27 const std::string& element_id);
28
12 // Returns whether the element with |element_id| in the passed |web_state| has 29 // Returns whether the element with |element_id| in the passed |web_state| has
13 // been tapped using a JavaScript click() event. 30 // been tapped using a JavaScript click() event.
14 bool TapWebViewElementWithId(web::WebState* web_state, 31 bool TapWebViewElementWithId(web::WebState* web_state,
15 const std::string& element_id); 32 const std::string& element_id);
16 33
17 // Returns whether the element with |element_id| in the passed |web_state| has 34 // Returns whether the element with |element_id| in the passed |web_state| has
18 // been focused using a JavaScript focus() event. 35 // been focused using a JavaScript focus() event.
19 bool FocusWebViewElementWithId(web::WebState* web_state, 36 bool FocusWebViewElementWithId(web::WebState* web_state,
20 const std::string& element_id); 37 const std::string& element_id);
21 38
22 // Returns whether the form with |form_id| in the passed |web_state| has been 39 // Returns whether the form with |form_id| in the passed |web_state| has been
23 // submitted using a JavaScript submit() event. 40 // submitted using a JavaScript submit() event.
24 bool SubmitWebViewFormWithId(web::WebState* web_state, 41 bool SubmitWebViewFormWithId(web::WebState* web_state,
25 const std::string& form_id); 42 const std::string& form_id);
26 } // namespace test 43 } // namespace test
27 } // namespace web 44 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698