| OLD | NEW |
| 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 | 7 |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif | 10 #endif |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "chrome/test/webdriver/error_codes.h" | 30 #include "chrome/test/webdriver/error_codes.h" |
| 31 #include "chrome/test/webdriver/session_manager.h" | 31 #include "chrome/test/webdriver/session_manager.h" |
| 32 #include "chrome/test/webdriver/utility_functions.h" | 32 #include "chrome/test/webdriver/utility_functions.h" |
| 33 #include "chrome/test/webdriver/commands/cookie_commands.h" | 33 #include "chrome/test/webdriver/commands/cookie_commands.h" |
| 34 #include "chrome/test/webdriver/commands/create_session.h" | 34 #include "chrome/test/webdriver/commands/create_session.h" |
| 35 #include "chrome/test/webdriver/commands/execute_command.h" | 35 #include "chrome/test/webdriver/commands/execute_command.h" |
| 36 #include "chrome/test/webdriver/commands/find_element_commands.h" | 36 #include "chrome/test/webdriver/commands/find_element_commands.h" |
| 37 #include "chrome/test/webdriver/commands/implicit_wait_command.h" | 37 #include "chrome/test/webdriver/commands/implicit_wait_command.h" |
| 38 #include "chrome/test/webdriver/commands/navigate_commands.h" | 38 #include "chrome/test/webdriver/commands/navigate_commands.h" |
| 39 #include "chrome/test/webdriver/commands/mouse_commands.h" | 39 #include "chrome/test/webdriver/commands/mouse_commands.h" |
| 40 #include "chrome/test/webdriver/commands/screenshot_command.h" |
| 40 #include "chrome/test/webdriver/commands/session_with_id.h" | 41 #include "chrome/test/webdriver/commands/session_with_id.h" |
| 41 #include "chrome/test/webdriver/commands/source_command.h" | 42 #include "chrome/test/webdriver/commands/source_command.h" |
| 42 #include "chrome/test/webdriver/commands/speed_command.h" | 43 #include "chrome/test/webdriver/commands/speed_command.h" |
| 43 #include "chrome/test/webdriver/commands/target_locator_commands.h" | 44 #include "chrome/test/webdriver/commands/target_locator_commands.h" |
| 44 #include "chrome/test/webdriver/commands/title_command.h" | 45 #include "chrome/test/webdriver/commands/title_command.h" |
| 45 #include "chrome/test/webdriver/commands/url_command.h" | 46 #include "chrome/test/webdriver/commands/url_command.h" |
| 46 #include "chrome/test/webdriver/commands/webelement_commands.h" | 47 #include "chrome/test/webdriver/commands/webelement_commands.h" |
| 47 #include "third_party/mongoose/mongoose.h" | 48 #include "third_party/mongoose/mongoose.h" |
| 48 | 49 |
| 49 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 dispatcher->Add<ElementLocationInViewCommand>( | 113 dispatcher->Add<ElementLocationInViewCommand>( |
| 113 "/session/*/element/*/location_in_view"); | 114 "/session/*/element/*/location_in_view"); |
| 114 dispatcher->Add<ElementNameCommand>( "/session/*/element/*/name"); | 115 dispatcher->Add<ElementNameCommand>( "/session/*/element/*/name"); |
| 115 dispatcher->Add<ElementSelectedCommand>("/session/*/element/*/selected"); | 116 dispatcher->Add<ElementSelectedCommand>("/session/*/element/*/selected"); |
| 116 dispatcher->Add<ElementSizeCommand>( "/session/*/element/*/size"); | 117 dispatcher->Add<ElementSizeCommand>( "/session/*/element/*/size"); |
| 117 dispatcher->Add<ElementSubmitCommand>( "/session/*/element/*/submit"); | 118 dispatcher->Add<ElementSubmitCommand>( "/session/*/element/*/submit"); |
| 118 dispatcher->Add<ElementTextCommand>( "/session/*/element/*/text"); | 119 dispatcher->Add<ElementTextCommand>( "/session/*/element/*/text"); |
| 119 dispatcher->Add<ElementToggleCommand>( "/session/*/element/*/toggle"); | 120 dispatcher->Add<ElementToggleCommand>( "/session/*/element/*/toggle"); |
| 120 dispatcher->Add<ElementValueCommand>( "/session/*/element/*/value"); | 121 dispatcher->Add<ElementValueCommand>( "/session/*/element/*/value"); |
| 121 | 122 |
| 123 dispatcher->Add<ScreenshotCommand>("/session/*/screenshot"); |
| 124 |
| 122 // Mouse Commands | 125 // Mouse Commands |
| 123 dispatcher->Add<ClickCommand>("/session/*/element/*/click"); | 126 dispatcher->Add<ClickCommand>("/session/*/element/*/click"); |
| 124 dispatcher->Add<DragCommand>( "/session/*/element/*/drag"); | 127 dispatcher->Add<DragCommand>( "/session/*/element/*/drag"); |
| 125 dispatcher->Add<HoverCommand>("/session/*/element/*/hover"); | 128 dispatcher->Add<HoverCommand>("/session/*/element/*/hover"); |
| 126 | 129 |
| 127 // Commands that have not been implemented yet. We list these out explicitly | 130 // Commands that have not been implemented yet. We list these out explicitly |
| 128 // so that tests that attempt to use them fail with a meaningful error. | 131 // so that tests that attempt to use them fail with a meaningful error. |
| 129 dispatcher->SetNotImplemented("/session/*/execute_async"); | 132 dispatcher->SetNotImplemented("/session/*/execute_async"); |
| 130 dispatcher->SetNotImplemented("/session/*/timeouts/async_script"); | 133 dispatcher->SetNotImplemented("/session/*/timeouts/async_script"); |
| 131 dispatcher->SetNotImplemented("/session/*/screenshot"); | |
| 132 | 134 |
| 133 // Since the /session/* is a wild card that would match the above URIs, this | 135 // Since the /session/* is a wild card that would match the above URIs, this |
| 134 // line MUST be the last registered URI with the server. | 136 // line MUST be the last registered URI with the server. |
| 135 dispatcher->Add<SessionWithID>("/session/*"); | 137 dispatcher->Add<SessionWithID>("/session/*"); |
| 136 } | 138 } |
| 137 | 139 |
| 138 } // namespace webdriver | 140 } // namespace webdriver |
| 139 | 141 |
| 140 // Configures mongoose according to the given command line flags. | 142 // Configures mongoose according to the given command line flags. |
| 141 // Returns true on success. | 143 // Returns true on success. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 241 |
| 240 // Run until we receive command to shutdown. | 242 // Run until we receive command to shutdown. |
| 241 shutdown_event.Wait(); | 243 shutdown_event.Wait(); |
| 242 | 244 |
| 243 // We should not reach here since the service should never quit. | 245 // We should not reach here since the service should never quit. |
| 244 // TODO(jmikhail): register a listener for SIGTERM and break the | 246 // TODO(jmikhail): register a listener for SIGTERM and break the |
| 245 // message loop gracefully. | 247 // message loop gracefully. |
| 246 mg_stop(ctx); | 248 mg_stop(ctx); |
| 247 return (EXIT_SUCCESS); | 249 return (EXIT_SUCCESS); |
| 248 } | 250 } |
| OLD | NEW |