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

Side by Side Diff: chrome/test/webdriver/server.cc

Issue 6482014: Implement sendKeys webdriver API in ChromeDriver. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/webdriver/commands/webelement_commands.cc ('k') | chrome/test/webdriver/session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <signal.h> 5 #include <signal.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #ifndef _WIN32 7 #ifndef _WIN32
8 #include <sys/time.h> 8 #include <sys/time.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <sys/wait.h> 10 #include <sys/wait.h>
(...skipping 21 matching lines...) Expand all
32 #include "chrome/test/webdriver/commands/create_session.h" 32 #include "chrome/test/webdriver/commands/create_session.h"
33 #include "chrome/test/webdriver/commands/execute_command.h" 33 #include "chrome/test/webdriver/commands/execute_command.h"
34 #include "chrome/test/webdriver/commands/find_element_commands.h" 34 #include "chrome/test/webdriver/commands/find_element_commands.h"
35 #include "chrome/test/webdriver/commands/implicit_wait_command.h" 35 #include "chrome/test/webdriver/commands/implicit_wait_command.h"
36 #include "chrome/test/webdriver/commands/navigate_commands.h" 36 #include "chrome/test/webdriver/commands/navigate_commands.h"
37 #include "chrome/test/webdriver/commands/session_with_id.h" 37 #include "chrome/test/webdriver/commands/session_with_id.h"
38 #include "chrome/test/webdriver/commands/source_command.h" 38 #include "chrome/test/webdriver/commands/source_command.h"
39 #include "chrome/test/webdriver/commands/speed_command.h" 39 #include "chrome/test/webdriver/commands/speed_command.h"
40 #include "chrome/test/webdriver/commands/title_command.h" 40 #include "chrome/test/webdriver/commands/title_command.h"
41 #include "chrome/test/webdriver/commands/url_command.h" 41 #include "chrome/test/webdriver/commands/url_command.h"
42 42 #include "chrome/test/webdriver/commands/webelement_commands.h"
43 #include "third_party/mongoose/mongoose.h" 43 #include "third_party/mongoose/mongoose.h"
44 44
45 // Make sure we have ho zombies from CGIs. 45 // Make sure we have ho zombies from CGIs.
46 static void 46 static void
47 signal_handler(int sig_num) { 47 signal_handler(int sig_num) {
48 switch (sig_num) { 48 switch (sig_num) {
49 #ifdef OS_POSIX 49 #ifdef OS_POSIX
50 case SIGCHLD: 50 case SIGCHLD:
51 while (waitpid(-1, &sig_num, WNOHANG) > 0) { } 51 while (waitpid(-1, &sig_num, WNOHANG) > 0) { }
52 break; 52 break;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 SetCallback<TitleCommand>(ctx, "/session/*/title"); 87 SetCallback<TitleCommand>(ctx, "/session/*/title");
88 SetCallback<URLCommand>(ctx, "/session/*/url"); 88 SetCallback<URLCommand>(ctx, "/session/*/url");
89 SetCallback<SpeedCommand>(ctx, "/session/*/speed"); 89 SetCallback<SpeedCommand>(ctx, "/session/*/speed");
90 SetCallback<ImplicitWaitCommand>(ctx, "/session/*/timeouts/implicit_wait"); 90 SetCallback<ImplicitWaitCommand>(ctx, "/session/*/timeouts/implicit_wait");
91 91
92 // WebElement commands 92 // WebElement commands
93 SetCallback<FindOneElementCommand>(ctx, "/session/*/element"); 93 SetCallback<FindOneElementCommand>(ctx, "/session/*/element");
94 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements"); 94 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements");
95 SetCallback<FindOneElementCommand>(ctx, "/session/*/element/*/element"); 95 SetCallback<FindOneElementCommand>(ctx, "/session/*/element/*/element");
96 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements/*/elements"); 96 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements/*/elements");
97 SetCallback<ElementValueCommand>(ctx, "/session/*/element/*/value");
98 SetCallback<ElementTextCommand>(ctx, "/session/*/element/*/text");
97 99
98 // Since the /session/* is a wild card that would match the above URIs, this 100 // Since the /session/* is a wild card that would match the above URIs, this
99 // line MUST be the last registered URI with the server. 101 // line MUST be the last registered URI with the server.
100 SetCallback<SessionWithID>(ctx, "/session/*"); 102 SetCallback<SessionWithID>(ctx, "/session/*");
101 } 103 }
104
102 } // namespace webdriver 105 } // namespace webdriver
103 106
104 // Configures mongoose according to the given command line flags. 107 // Configures mongoose according to the given command line flags.
105 // Returns true on success. 108 // Returns true on success.
106 bool SetMongooseOptions(struct mg_context* ctx, 109 bool SetMongooseOptions(struct mg_context* ctx,
107 const std::string& port, 110 const std::string& port,
108 const std::string& root) { 111 const std::string& root) {
109 if (!mg_set_option(ctx, "ports", port.c_str())) { 112 if (!mg_set_option(ctx, "ports", port.c_str())) {
110 std::cout << "ChromeDriver cannot bind to port (" 113 std::cout << "ChromeDriver cannot bind to port ("
111 << port.c_str() << ")" << std::endl; 114 << port.c_str() << ")" << std::endl;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 180
178 // Run until we receive command to shutdown. 181 // Run until we receive command to shutdown.
179 shutdown_event.Wait(); 182 shutdown_event.Wait();
180 183
181 // We should not reach here since the service should never quit. 184 // We should not reach here since the service should never quit.
182 // TODO(jmikhail): register a listener for SIGTERM and break the 185 // TODO(jmikhail): register a listener for SIGTERM and break the
183 // message loop gracefully. 186 // message loop gracefully.
184 mg_stop(ctx); 187 mg_stop(ctx);
185 return (EXIT_SUCCESS); 188 return (EXIT_SUCCESS);
186 } 189 }
OLDNEW
« no previous file with comments | « chrome/test/webdriver/commands/webelement_commands.cc ('k') | chrome/test/webdriver/session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698