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

Unified Diff: chrome/test/chromedriver/window_commands.cc

Issue 2743013002: Add webdriver endpoint to send custom debugger commands (Closed)
Patch Set: Adding stub, quick code reorg Created 3 years, 7 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 | « chrome/test/chromedriver/window_commands.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/window_commands.cc
diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc
index 9703653055f520a19a9c881d3cc953fe916bf936..e54307f62a6f5179d31ccf7f89000474e56877b2 100644
--- a/chrome/test/chromedriver/window_commands.cc
+++ b/chrome/test/chromedriver/window_commands.cc
@@ -715,6 +715,38 @@ Status ExecuteTouchPinch(Session* session,
return web_view->SynthesizePinchGesture(location.x, location.y, scale_factor);
}
+Status ExecuteSendCommand(Session* session,
+ WebView* web_view,
+ const base::DictionaryValue& params,
+ std::unique_ptr<base::Value>* value,
+ Timeout* timeout) {
+ std::string cmd;
+ if (!params.GetString("cmd", &cmd)) {
+ return Status(kUnknownError, "command not passed");
+ }
+ const base::DictionaryValue* cmdParams;
+ if (!params.GetDictionary("params", &cmdParams)) {
+ return Status(kUnknownError, "params not passed");
+ }
+ return web_view->SendCommand(cmd, *cmdParams);
+}
+
+Status ExecuteSendCommandAndGetResult(Session* session,
+ WebView* web_view,
+ const base::DictionaryValue& params,
+ std::unique_ptr<base::Value>* value,
+ Timeout* timeout) {
+ std::string cmd;
+ if (!params.GetString("cmd", &cmd)) {
+ return Status(kUnknownError, "command not passed");
+ }
+ const base::DictionaryValue* cmdParams;
+ if (!params.GetDictionary("params", &cmdParams)) {
+ return Status(kUnknownError, "params not passed");
+ }
+ return web_view->SendCommandAndGetResult(cmd, *cmdParams, value);
+}
+
Status ExecuteGetActiveElement(Session* session,
WebView* web_view,
const base::DictionaryValue& params,
« no previous file with comments | « chrome/test/chromedriver/window_commands.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698