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

Unified Diff: chrome/test/webdriver/server.cc

Issue 3643002: Implemnts the commands in webdriver to preform searching of elements on a page. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: update Created 10 years, 1 month 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: chrome/test/webdriver/server.cc
diff --git a/chrome/test/webdriver/server.cc b/chrome/test/webdriver/server.cc
index f80659b495167d37ee5ecdaf188e3fdff24d0b45..75dba2db0fc98718d1e2c62dacb555f4e2d327eb 100644
--- a/chrome/test/webdriver/server.cc
+++ b/chrome/test/webdriver/server.cc
@@ -26,6 +26,8 @@
#include "chrome/test/webdriver/utility_functions.h"
#include "chrome/test/webdriver/commands/create_session.h"
#include "chrome/test/webdriver/commands/execute_command.h"
+#include "chrome/test/webdriver/commands/find_element_commands.h"
+#include "chrome/test/webdriver/commands/implicit_wait_command.h"
#include "chrome/test/webdriver/commands/navigate_commands.h"
#include "chrome/test/webdriver/commands/session_with_id.h"
#include "chrome/test/webdriver/commands/source_command.h"
@@ -66,6 +68,13 @@ void InitCallbacks(struct mg_context* ctx) {
SetCallback<TitleCommand>(ctx, "/session/*/title");
SetCallback<URLCommand>(ctx, "/session/*/url");
+ // WebElement commands
+ SetCallback<ImplicitWaitCommand>(ctx, "/session/*/timeouts/implicit_wait");
+ SetCallback<FindOneElementCommand>(ctx, "/session/*/element");
+ SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements");
+ SetCallback<FindOneElementCommand>(ctx, "/session/*/element/*/element");
+ SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements/*/elements");
+
// Since the /session/* is a wild card that would match the above URIs, this
// line MUST be the last registered URI with the server.
SetCallback<SessionWithID>(ctx, "/session/*");
@@ -78,7 +87,7 @@ void InitCallbacks(struct mg_context* ctx) {
int main(int argc, char *argv[]) {
struct mg_context *ctx;
base::AtExitManager exit;
- std::string port = "8080";
+ std::string port = "9515";
#ifdef OS_POSIX
CommandLine cmd_line = CommandLine(argc, argv);
#elif OS_WIN
@@ -109,14 +118,14 @@ int main(int argc, char *argv[]) {
session->SetIPAddress(port);
// Initialize SHTTPD context.
- // Listen on port 8080 or port specified on command line.
- // TODO(jmikhail) Maybe add port 8081 as a secure connection.
+ // Listen on port 9515 or port specified on command line.
+ // TODO(jmikhail) Maybe add port 9516 as a secure connection.
ctx = mg_start();
mg_set_option(ctx, "ports", port.c_str());
webdriver::InitCallbacks(ctx);
- std::cout << "Starting server" << std::endl;
+ std::cout << "Starting server on port: " << port << std::endl;
// The default behavior is to run this service forever.
while (true)
PlatformThread::Sleep(3600);

Powered by Google App Engine
This is Rietveld 408576698