| OLD | NEW |
| 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 "ios/web/public/web_state/web_state.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 namespace web { | 9 namespace web { |
| 10 namespace test { | 10 namespace test { |
| 11 | 11 |
| 12 enum ElementAction { CLICK, FOCUS }; | 12 // Returns whether the element with |element_id| in the passed |web_state| has |
| 13 | 13 // been tapped using a JavaScript click() event. |
| 14 // Attempts to tap the element with |element_id| in the passed in |web_state| | 14 bool TapWebViewElementWithId(web::WebState* web_state, |
| 15 // using a JavaScript click() event. | |
| 16 void TapWebViewElementWithId(web::WebState* web_state, | |
| 17 const std::string& element_id); | 15 const std::string& element_id); |
| 18 | 16 |
| 19 // Attempts to run the Javascript action specified by |action| on |element_id| | 17 // Returns whether the element with |element_id| in the passed |web_state| has |
| 20 // in the passed |web_state|. | 18 // been focused using a JavaScript focus() event. |
| 21 void RunActionOnWebViewElementWithId(web::WebState* web_state, | 19 bool FocusWebViewElementWithId(web::WebState* web_state, |
| 22 const std::string& element_id, | 20 const std::string& element_id); |
| 23 ElementAction action); | |
| 24 | 21 |
| 25 } // namespace test | 22 } // namespace test |
| 26 } // namespace web | 23 } // namespace web |
| OLD | NEW |