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_
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"
16 class DictionaryValue
;
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
);
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
,
46 const base::DictionaryValue
& params
,
47 scoped_ptr
<base::Value
>* value
);
53 const base::DictionaryValue
& params
,
54 scoped_ptr
<base::Value
>* value
);
56 // Gets the capabilities of a particular session.
57 Status
ExecuteGetSessionCapabilities(
59 const base::DictionaryValue
& params
,
60 scoped_ptr
<base::Value
>* value
);
62 // Retrieve the handle of the target window.
63 Status
ExecuteGetCurrentWindowHandle(
65 const base::DictionaryValue
& params
,
66 scoped_ptr
<base::Value
>* value
);
68 // Close the target window.
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(
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(
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(
91 const base::DictionaryValue
& params
,
92 scoped_ptr
<base::Value
>* value
);
94 // Set the timeout for asynchronous scripts.
95 Status
ExecuteSetScriptTimeout(
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(
103 const base::DictionaryValue
& params
,
104 scoped_ptr
<base::Value
>* value
);
106 Status
ExecuteIsLoading(
108 const base::DictionaryValue
& params
,
109 scoped_ptr
<base::Value
>* value
);
111 Status
ExecuteLaunchApp(
113 const base::DictionaryValue
& params
,
114 scoped_ptr
<base::Value
>* value
);
116 Status
ExecuteGetLocation(
118 const base::DictionaryValue
& params
,
119 scoped_ptr
<base::Value
>* value
);
121 Status
ExecuteGetWindowPosition(
123 const base::DictionaryValue
& params
,
124 scoped_ptr
<base::Value
>* value
);
126 Status
ExecuteSetWindowPosition(
128 const base::DictionaryValue
& params
,
129 scoped_ptr
<base::Value
>* value
);
131 Status
ExecuteGetWindowSize(
133 const base::DictionaryValue
& params
,
134 scoped_ptr
<base::Value
>* value
);
136 Status
ExecuteSetWindowSize(
138 const base::DictionaryValue
& params
,
139 scoped_ptr
<base::Value
>* value
);
141 Status
ExecuteMaximizeWindow(
143 const base::DictionaryValue
& params
,
144 scoped_ptr
<base::Value
>* value
);
146 Status
ExecuteGetAvailableLogTypes(
148 const base::DictionaryValue
& params
,
149 scoped_ptr
<base::Value
>* value
);
151 Status
ExecuteGetLog(
153 const base::DictionaryValue
& params
,
154 scoped_ptr
<base::Value
>* value
);
156 Status
ExecuteUploadFile(
158 const base::DictionaryValue
& params
,
159 scoped_ptr
<base::Value
>* value
);
161 Status
ExecuteIsAutoReporting(
163 const base::DictionaryValue
& params
,
164 scoped_ptr
<base::Value
>* value
);
166 Status
ExecuteSetAutoReporting(
168 const base::DictionaryValue
& params
,
169 scoped_ptr
<base::Value
>* value
);
171 #endif // CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_