Roll src/third_party/WebKit bf18a82:a9cee16 (svn 185297:185304)
[chromium-blink-merge.git] / chrome / test / chromedriver / session_commands.h
blobc30ceffc517b995ce12c619b0f1e2eb253578317
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_
6 #define CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_
8 #include <string>
10 #include "base/callback_forward.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/test/chromedriver/command.h"
13 #include "chrome/test/chromedriver/net/sync_websocket_factory.h"
15 namespace base {
16 class DictionaryValue;
17 class Value;
20 class DeviceManager;
21 class PortManager;
22 class PortServer;
23 struct Session;
24 class Status;
25 class URLRequestContextGetter;
27 struct InitSessionParams {
28 InitSessionParams(scoped_refptr<URLRequestContextGetter> context_getter,
29 const SyncWebSocketFactory& socket_factory,
30 DeviceManager* device_manager,
31 PortServer* port_server,
32 PortManager* port_manager);
33 ~InitSessionParams();
35 scoped_refptr<URLRequestContextGetter> context_getter;
36 SyncWebSocketFactory socket_factory;
37 DeviceManager* device_manager;
38 PortServer* port_server;
39 PortManager* port_manager;
42 // Initializes a session.
43 Status ExecuteInitSession(
44 const InitSessionParams& bound_params,
45 Session* session,
46 const base::DictionaryValue& params,
47 scoped_ptr<base::Value>* value);
49 // Quits a session.
50 Status ExecuteQuit(
51 bool allow_detach,
52 Session* session,
53 const base::DictionaryValue& params,
54 scoped_ptr<base::Value>* value);
56 // Gets the capabilities of a particular session.
57 Status ExecuteGetSessionCapabilities(
58 Session* session,
59 const base::DictionaryValue& params,
60 scoped_ptr<base::Value>* value);
62 // Retrieve the handle of the target window.
63 Status ExecuteGetCurrentWindowHandle(
64 Session* session,
65 const base::DictionaryValue& params,
66 scoped_ptr<base::Value>* value);
68 // Close the target window.
69 Status ExecuteClose(
70 Session* session,
71 const base::DictionaryValue& params,
72 scoped_ptr<base::Value>* value);
74 // Retrieve the list of all window handles available to the session.
75 Status ExecuteGetWindowHandles(
76 Session* session,
77 const base::DictionaryValue& params,
78 scoped_ptr<base::Value>* value);
80 // Change target window to another. The window to target at may be specified by
81 // its server assigned window handle, or by the value of its name attribute.
82 Status ExecuteSwitchToWindow(
83 Session* session,
84 const base::DictionaryValue& params,
85 scoped_ptr<base::Value>* value);
87 // Configure the amount of time that a particular type of operation can execute
88 // for before they are aborted and a timeout error is returned to the client.
89 Status ExecuteSetTimeout(
90 Session* session,
91 const base::DictionaryValue& params,
92 scoped_ptr<base::Value>* value);
94 // Set the timeout for asynchronous scripts.
95 Status ExecuteSetScriptTimeout(
96 Session* session,
97 const base::DictionaryValue& params,
98 scoped_ptr<base::Value>* value);
100 // Set the amount of time the driver should wait when searching for elements.
101 Status ExecuteImplicitlyWait(
102 Session* session,
103 const base::DictionaryValue& params,
104 scoped_ptr<base::Value>* value);
106 Status ExecuteIsLoading(
107 Session* session,
108 const base::DictionaryValue& params,
109 scoped_ptr<base::Value>* value);
111 Status ExecuteLaunchApp(
112 Session* session,
113 const base::DictionaryValue& params,
114 scoped_ptr<base::Value>* value);
116 Status ExecuteGetLocation(
117 Session* session,
118 const base::DictionaryValue& params,
119 scoped_ptr<base::Value>* value);
121 Status ExecuteGetWindowPosition(
122 Session* session,
123 const base::DictionaryValue& params,
124 scoped_ptr<base::Value>* value);
126 Status ExecuteSetWindowPosition(
127 Session* session,
128 const base::DictionaryValue& params,
129 scoped_ptr<base::Value>* value);
131 Status ExecuteGetWindowSize(
132 Session* session,
133 const base::DictionaryValue& params,
134 scoped_ptr<base::Value>* value);
136 Status ExecuteSetWindowSize(
137 Session* session,
138 const base::DictionaryValue& params,
139 scoped_ptr<base::Value>* value);
141 Status ExecuteMaximizeWindow(
142 Session* session,
143 const base::DictionaryValue& params,
144 scoped_ptr<base::Value>* value);
146 Status ExecuteGetAvailableLogTypes(
147 Session* session,
148 const base::DictionaryValue& params,
149 scoped_ptr<base::Value>* value);
151 Status ExecuteGetLog(
152 Session* session,
153 const base::DictionaryValue& params,
154 scoped_ptr<base::Value>* value);
156 Status ExecuteUploadFile(
157 Session* session,
158 const base::DictionaryValue& params,
159 scoped_ptr<base::Value>* value);
161 Status ExecuteIsAutoReporting(
162 Session* session,
163 const base::DictionaryValue& params,
164 scoped_ptr<base::Value>* value);
166 Status ExecuteSetAutoReporting(
167 Session* session,
168 const base::DictionaryValue& params,
169 scoped_ptr<base::Value>* value);
171 #endif // CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_