| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 13 matching lines...) Expand all Loading... |
| 24 #include "base/synchronization/waitable_event.h" | 24 #include "base/synchronization/waitable_event.h" |
| 25 #include "base/test/test_timeouts.h" | 25 #include "base/test/test_timeouts.h" |
| 26 #include "base/threading/platform_thread.h" | 26 #include "base/threading/platform_thread.h" |
| 27 #include "base/utf_string_conversions.h" | 27 #include "base/utf_string_conversions.h" |
| 28 #include "chrome/common/chrome_constants.h" | 28 #include "chrome/common/chrome_constants.h" |
| 29 #include "chrome/common/chrome_paths.h" | 29 #include "chrome/common/chrome_paths.h" |
| 30 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/test/webdriver/commands/alert_commands.h" | 31 #include "chrome/test/webdriver/commands/alert_commands.h" |
| 32 #include "chrome/test/webdriver/commands/appcache_status_command.h" | 32 #include "chrome/test/webdriver/commands/appcache_status_command.h" |
| 33 #include "chrome/test/webdriver/commands/browser_connection_commands.h" | 33 #include "chrome/test/webdriver/commands/browser_connection_commands.h" |
| 34 #include "chrome/test/webdriver/commands/chrome_commands.h" |
| 34 #include "chrome/test/webdriver/commands/cookie_commands.h" | 35 #include "chrome/test/webdriver/commands/cookie_commands.h" |
| 35 #include "chrome/test/webdriver/commands/create_session.h" | 36 #include "chrome/test/webdriver/commands/create_session.h" |
| 36 #include "chrome/test/webdriver/commands/execute_async_script_command.h" | 37 #include "chrome/test/webdriver/commands/execute_async_script_command.h" |
| 37 #include "chrome/test/webdriver/commands/execute_command.h" | 38 #include "chrome/test/webdriver/commands/execute_command.h" |
| 38 #include "chrome/test/webdriver/commands/find_element_commands.h" | 39 #include "chrome/test/webdriver/commands/find_element_commands.h" |
| 39 #include "chrome/test/webdriver/commands/navigate_commands.h" | 40 #include "chrome/test/webdriver/commands/navigate_commands.h" |
| 40 #include "chrome/test/webdriver/commands/mouse_commands.h" | 41 #include "chrome/test/webdriver/commands/mouse_commands.h" |
| 41 #include "chrome/test/webdriver/commands/screenshot_command.h" | 42 #include "chrome/test/webdriver/commands/screenshot_command.h" |
| 42 #include "chrome/test/webdriver/commands/session_with_id.h" | 43 #include "chrome/test/webdriver/commands/session_with_id.h" |
| 43 #include "chrome/test/webdriver/commands/set_timeout_commands.h" | 44 #include "chrome/test/webdriver/commands/set_timeout_commands.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 "/session/*/timeouts/async_script"); | 135 "/session/*/timeouts/async_script"); |
| 135 dispatcher->Add<ImplicitWaitCommand>( "/session/*/timeouts/implicit_wait"); | 136 dispatcher->Add<ImplicitWaitCommand>( "/session/*/timeouts/implicit_wait"); |
| 136 | 137 |
| 137 // Cookie functions. | 138 // Cookie functions. |
| 138 dispatcher->Add<CookieCommand>( "/session/*/cookie"); | 139 dispatcher->Add<CookieCommand>( "/session/*/cookie"); |
| 139 dispatcher->Add<NamedCookieCommand>("/session/*/cookie/*"); | 140 dispatcher->Add<NamedCookieCommand>("/session/*/cookie/*"); |
| 140 | 141 |
| 141 dispatcher->Add<BrowserConnectionCommand>("/session/*/browser_connection"); | 142 dispatcher->Add<BrowserConnectionCommand>("/session/*/browser_connection"); |
| 142 dispatcher->Add<AppCacheStatusCommand>("/session/*/application_cache/status"); | 143 dispatcher->Add<AppCacheStatusCommand>("/session/*/application_cache/status"); |
| 143 | 144 |
| 145 // Chrome-specific command. |
| 146 dispatcher->Add<ExtensionsCommand>("/session/*/chrome/extensions"); |
| 147 |
| 144 // Since the /session/* is a wild card that would match the above URIs, this | 148 // Since the /session/* is a wild card that would match the above URIs, this |
| 145 // line MUST be after all other webdriver command callbacks. | 149 // line MUST be after all other webdriver command callbacks. |
| 146 dispatcher->Add<SessionWithID>("/session/*"); | 150 dispatcher->Add<SessionWithID>("/session/*"); |
| 147 | 151 |
| 148 if (forbid_other_requests) | 152 if (forbid_other_requests) |
| 149 dispatcher->ForbidAllOtherRequests(); | 153 dispatcher->ForbidAllOtherRequests(); |
| 150 } | 154 } |
| 151 | 155 |
| 152 } // namespace webdriver | 156 } // namespace webdriver |
| 153 | 157 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 262 |
| 259 // Run until we receive command to shutdown. | 263 // Run until we receive command to shutdown. |
| 260 shutdown_event.Wait(); | 264 shutdown_event.Wait(); |
| 261 | 265 |
| 262 // We should not reach here since the service should never quit. | 266 // We should not reach here since the service should never quit. |
| 263 // TODO(jmikhail): register a listener for SIGTERM and break the | 267 // TODO(jmikhail): register a listener for SIGTERM and break the |
| 264 // message loop gracefully. | 268 // message loop gracefully. |
| 265 mg_stop(ctx); | 269 mg_stop(ctx); |
| 266 return (EXIT_SUCCESS); | 270 return (EXIT_SUCCESS); |
| 267 } | 271 } |
| OLD | NEW |