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 #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 11 matching lines...) Expand all Loading... |
22 #include "base/string_split.h" | 22 #include "base/string_split.h" |
23 #include "base/string_util.h" | 23 #include "base/string_util.h" |
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_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
29 #include "chrome/test/webdriver/dispatch.h" | 29 #include "chrome/test/webdriver/dispatch.h" |
30 #include "chrome/test/webdriver/session_manager.h" | 30 #include "chrome/test/webdriver/session_manager.h" |
31 #include "chrome/test/webdriver/utility_functions.h" | 31 #include "chrome/test/webdriver/utility_functions.h" |
| 32 #include "chrome/test/webdriver/commands/cookie_commands.h" |
32 #include "chrome/test/webdriver/commands/create_session.h" | 33 #include "chrome/test/webdriver/commands/create_session.h" |
33 #include "chrome/test/webdriver/commands/execute_command.h" | 34 #include "chrome/test/webdriver/commands/execute_command.h" |
34 #include "chrome/test/webdriver/commands/find_element_commands.h" | 35 #include "chrome/test/webdriver/commands/find_element_commands.h" |
35 #include "chrome/test/webdriver/commands/implicit_wait_command.h" | 36 #include "chrome/test/webdriver/commands/implicit_wait_command.h" |
36 #include "chrome/test/webdriver/commands/navigate_commands.h" | 37 #include "chrome/test/webdriver/commands/navigate_commands.h" |
37 #include "chrome/test/webdriver/commands/session_with_id.h" | 38 #include "chrome/test/webdriver/commands/session_with_id.h" |
38 #include "chrome/test/webdriver/commands/source_command.h" | 39 #include "chrome/test/webdriver/commands/source_command.h" |
39 #include "chrome/test/webdriver/commands/speed_command.h" | 40 #include "chrome/test/webdriver/commands/speed_command.h" |
40 #include "chrome/test/webdriver/commands/title_command.h" | 41 #include "chrome/test/webdriver/commands/title_command.h" |
41 #include "chrome/test/webdriver/commands/url_command.h" | 42 #include "chrome/test/webdriver/commands/url_command.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 SetCallback<BackCommand>(ctx, "/session/*/back"); | 83 SetCallback<BackCommand>(ctx, "/session/*/back"); |
83 SetCallback<ExecuteCommand>(ctx, "/session/*/execute"); | 84 SetCallback<ExecuteCommand>(ctx, "/session/*/execute"); |
84 SetCallback<ForwardCommand>(ctx, "/session/*/forward"); | 85 SetCallback<ForwardCommand>(ctx, "/session/*/forward"); |
85 SetCallback<RefreshCommand>(ctx, "/session/*/refresh"); | 86 SetCallback<RefreshCommand>(ctx, "/session/*/refresh"); |
86 SetCallback<SourceCommand>(ctx, "/session/*/source"); | 87 SetCallback<SourceCommand>(ctx, "/session/*/source"); |
87 SetCallback<TitleCommand>(ctx, "/session/*/title"); | 88 SetCallback<TitleCommand>(ctx, "/session/*/title"); |
88 SetCallback<URLCommand>(ctx, "/session/*/url"); | 89 SetCallback<URLCommand>(ctx, "/session/*/url"); |
89 SetCallback<SpeedCommand>(ctx, "/session/*/speed"); | 90 SetCallback<SpeedCommand>(ctx, "/session/*/speed"); |
90 SetCallback<ImplicitWaitCommand>(ctx, "/session/*/timeouts/implicit_wait"); | 91 SetCallback<ImplicitWaitCommand>(ctx, "/session/*/timeouts/implicit_wait"); |
91 | 92 |
| 93 // Cookie functions. |
| 94 SetCallback<CookieCommand>(ctx, "/session/*/cookie"); |
| 95 SetCallback<NamedCookieCommand>(ctx, "/session/*/cookie/*"); |
| 96 |
92 // WebElement commands | 97 // WebElement commands |
93 SetCallback<FindOneElementCommand>(ctx, "/session/*/element"); | 98 SetCallback<FindOneElementCommand>(ctx, "/session/*/element"); |
94 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements"); | 99 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements"); |
95 SetCallback<FindOneElementCommand>(ctx, "/session/*/element/*/element"); | 100 SetCallback<FindOneElementCommand>(ctx, "/session/*/element/*/element"); |
96 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements/*/elements"); | 101 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements/*/elements"); |
97 | 102 |
98 // Since the /session/* is a wild card that would match the above URIs, this | 103 // 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. | 104 // line MUST be the last registered URI with the server. |
100 SetCallback<SessionWithID>(ctx, "/session/*"); | 105 SetCallback<SessionWithID>(ctx, "/session/*"); |
101 } | 106 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 182 |
178 // Run until we receive command to shutdown. | 183 // Run until we receive command to shutdown. |
179 shutdown_event.Wait(); | 184 shutdown_event.Wait(); |
180 | 185 |
181 // We should not reach here since the service should never quit. | 186 // We should not reach here since the service should never quit. |
182 // TODO(jmikhail): register a listener for SIGTERM and break the | 187 // TODO(jmikhail): register a listener for SIGTERM and break the |
183 // message loop gracefully. | 188 // message loop gracefully. |
184 mg_stop(ctx); | 189 mg_stop(ctx); |
185 return (EXIT_SUCCESS); | 190 return (EXIT_SUCCESS); |
186 } | 191 } |
OLD | NEW |