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

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

Issue 6330012: Cookie commands for the webdriver protocol (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update 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
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>
11 #else 11 #else
12 #include <time.h> 12 #include <time.h>
13 #endif 13 #endif
14 #include <iostream> 14 #include <iostream>
15 #include <fstream> 15 #include <fstream>
16 16
17 #include "base/at_exit.h" 17 #include "base/at_exit.h"
18 #include "base/command_line.h" 18 #include "base/command_line.h"
19 #include "base/logging.h" 19 #include "base/logging.h"
20 #include "base/scoped_ptr.h" 20 #include "base/scoped_ptr.h"
21 #include "base/string_util.h" 21 #include "base/string_util.h"
22 #include "base/threading/platform_thread.h" 22 #include "base/threading/platform_thread.h"
23 #include "base/utf_string_conversions.h" 23 #include "base/utf_string_conversions.h"
24 24
25 #include "chrome/test/webdriver/dispatch.h" 25 #include "chrome/test/webdriver/dispatch.h"
26 #include "chrome/test/webdriver/session_manager.h" 26 #include "chrome/test/webdriver/session_manager.h"
27 #include "chrome/test/webdriver/utility_functions.h" 27 #include "chrome/test/webdriver/utility_functions.h"
28 #include "chrome/test/webdriver/commands/cookie_commands.h"
28 #include "chrome/test/webdriver/commands/create_session.h" 29 #include "chrome/test/webdriver/commands/create_session.h"
29 #include "chrome/test/webdriver/commands/execute_command.h" 30 #include "chrome/test/webdriver/commands/execute_command.h"
30 #include "chrome/test/webdriver/commands/find_element_commands.h" 31 #include "chrome/test/webdriver/commands/find_element_commands.h"
31 #include "chrome/test/webdriver/commands/implicit_wait_command.h" 32 #include "chrome/test/webdriver/commands/implicit_wait_command.h"
32 #include "chrome/test/webdriver/commands/navigate_commands.h" 33 #include "chrome/test/webdriver/commands/navigate_commands.h"
33 #include "chrome/test/webdriver/commands/session_with_id.h" 34 #include "chrome/test/webdriver/commands/session_with_id.h"
34 #include "chrome/test/webdriver/commands/source_command.h" 35 #include "chrome/test/webdriver/commands/source_command.h"
35 #include "chrome/test/webdriver/commands/speed_command.h" 36 #include "chrome/test/webdriver/commands/speed_command.h"
36 #include "chrome/test/webdriver/commands/title_command.h" 37 #include "chrome/test/webdriver/commands/title_command.h"
37 #include "chrome/test/webdriver/commands/url_command.h" 38 #include "chrome/test/webdriver/commands/url_command.h"
(...skipping 27 matching lines...) Expand all
65 SetCallback<CreateSession>(ctx, "/session"); 66 SetCallback<CreateSession>(ctx, "/session");
66 SetCallback<BackCommand>(ctx, "/session/*/back"); 67 SetCallback<BackCommand>(ctx, "/session/*/back");
67 SetCallback<ExecuteCommand>(ctx, "/session/*/execute"); 68 SetCallback<ExecuteCommand>(ctx, "/session/*/execute");
68 SetCallback<ForwardCommand>(ctx, "/session/*/forward"); 69 SetCallback<ForwardCommand>(ctx, "/session/*/forward");
69 SetCallback<RefreshCommand>(ctx, "/session/*/refresh"); 70 SetCallback<RefreshCommand>(ctx, "/session/*/refresh");
70 SetCallback<SourceCommand>(ctx, "/session/*/source"); 71 SetCallback<SourceCommand>(ctx, "/session/*/source");
71 SetCallback<TitleCommand>(ctx, "/session/*/title"); 72 SetCallback<TitleCommand>(ctx, "/session/*/title");
72 SetCallback<URLCommand>(ctx, "/session/*/url"); 73 SetCallback<URLCommand>(ctx, "/session/*/url");
73 SetCallback<SpeedCommand>(ctx, "/session/*/speed"); 74 SetCallback<SpeedCommand>(ctx, "/session/*/speed");
74 75
76 // Cookie functions.
77 SetCallback<CookieCommand>(ctx, "/session/*/cookie");
78 SetCallback<NamedCookieCommand>(ctx, "/session/*/cookie/*");
79
75 // WebElement commands 80 // WebElement commands
76 SetCallback<ImplicitWaitCommand>(ctx, "/session/*/timeouts/implicit_wait"); 81 SetCallback<ImplicitWaitCommand>(ctx, "/session/*/timeouts/implicit_wait");
77 SetCallback<FindOneElementCommand>(ctx, "/session/*/element"); 82 SetCallback<FindOneElementCommand>(ctx, "/session/*/element");
78 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements"); 83 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements");
79 SetCallback<FindOneElementCommand>(ctx, "/session/*/element/*/element"); 84 SetCallback<FindOneElementCommand>(ctx, "/session/*/element/*/element");
80 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements/*/elements"); 85 SetCallback<FindManyElementsCommand>(ctx, "/session/*/elements/*/elements");
81 86
82 // Since the /session/* is a wild card that would match the above URIs, this 87 // Since the /session/* is a wild card that would match the above URIs, this
83 // line MUST be the last registered URI with the server. 88 // line MUST be the last registered URI with the server.
84 SetCallback<SessionWithID>(ctx, "/session/*"); 89 SetCallback<SessionWithID>(ctx, "/session/*");
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // The default behavior is to run this service forever. 136 // The default behavior is to run this service forever.
132 while (true) 137 while (true)
133 base::PlatformThread::Sleep(3600); 138 base::PlatformThread::Sleep(3600);
134 139
135 // We should not reach here since the service should never quit. 140 // We should not reach here since the service should never quit.
136 // TODO(jmikhail): register a listener for SIGTERM and break the 141 // TODO(jmikhail): register a listener for SIGTERM and break the
137 // message loop gracefully. 142 // message loop gracefully.
138 mg_stop(ctx); 143 mg_stop(ctx);
139 return (EXIT_SUCCESS); 144 return (EXIT_SUCCESS);
140 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698