OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_ |
6 #define CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/test/chromedriver/session_map.h" | 12 #include "chrome/test/chromedriver/command.h" |
| 13 #include "chrome/test/chromedriver/session_thread_map.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class DictionaryValue; | 16 class DictionaryValue; |
16 class Value; | 17 class Value; |
17 } | 18 } |
18 | 19 |
19 struct Session; | 20 struct Session; |
20 class Status; | 21 class Status; |
21 | 22 |
22 typedef base::Callback<Status( | 23 // Quits a session. |
| 24 Status ExecuteQuit( |
| 25 bool allow_detach, |
23 Session* session, | 26 Session* session, |
24 const base::DictionaryValue&, | |
25 scoped_ptr<base::Value>*)> SessionCommand; | |
26 | |
27 // Executes a given session command, after acquiring access to the appropriate | |
28 // session. | |
29 Status ExecuteSessionCommand( | |
30 SessionMap* session_map, | |
31 const SessionCommand& command, | |
32 const base::DictionaryValue& params, | 27 const base::DictionaryValue& params, |
33 const std::string& session_id, | 28 scoped_ptr<base::Value>* value); |
34 scoped_ptr<base::Value>* out_value, | |
35 std::string* out_session_id); | |
36 | 29 |
37 // Gets the capabilities of a particular session. | 30 // Gets the capabilities of a particular session. |
38 Status ExecuteGetSessionCapabilities( | 31 Status ExecuteGetSessionCapabilities( |
39 SessionMap* session_map, | |
40 Session* session, | 32 Session* session, |
41 const base::DictionaryValue& params, | 33 const base::DictionaryValue& params, |
42 scoped_ptr<base::Value>* value); | 34 scoped_ptr<base::Value>* value); |
43 | 35 |
44 // Retrieve the handle of the target window. | 36 // Retrieve the handle of the target window. |
45 Status ExecuteGetCurrentWindowHandle( | 37 Status ExecuteGetCurrentWindowHandle( |
46 Session* session, | 38 Session* session, |
47 const base::DictionaryValue& params, | 39 const base::DictionaryValue& params, |
48 scoped_ptr<base::Value>* value); | 40 scoped_ptr<base::Value>* value); |
49 | 41 |
50 // Close the target window. | 42 // Close the target window. |
51 Status ExecuteClose( | 43 Status ExecuteClose( |
52 SessionMap* session_map, | |
53 Session* session, | 44 Session* session, |
54 const base::DictionaryValue& params, | 45 const base::DictionaryValue& params, |
55 scoped_ptr<base::Value>* value); | 46 scoped_ptr<base::Value>* value); |
56 | 47 |
57 // Retrieve the list of all window handles available to the session. | 48 // Retrieve the list of all window handles available to the session. |
58 Status ExecuteGetWindowHandles( | 49 Status ExecuteGetWindowHandles( |
59 Session* session, | 50 Session* session, |
60 const base::DictionaryValue& params, | 51 const base::DictionaryValue& params, |
61 scoped_ptr<base::Value>* value); | 52 scoped_ptr<base::Value>* value); |
62 | 53 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 Session* session, | 121 Session* session, |
131 const base::DictionaryValue& params, | 122 const base::DictionaryValue& params, |
132 scoped_ptr<base::Value>* value); | 123 scoped_ptr<base::Value>* value); |
133 | 124 |
134 Status ExecuteUploadFile( | 125 Status ExecuteUploadFile( |
135 Session* session, | 126 Session* session, |
136 const base::DictionaryValue& params, | 127 const base::DictionaryValue& params, |
137 scoped_ptr<base::Value>* value); | 128 scoped_ptr<base::Value>* value); |
138 | 129 |
139 #endif // CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_ | 130 #endif // CHROME_TEST_CHROMEDRIVER_SESSION_COMMANDS_H_ |
OLD | NEW |