OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROMEDRIVER_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROMEDRIVER_H_ |
6 #define CHROME_TEST_CHROMEDRIVER_CHROMEDRIVER_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_CHROMEDRIVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 | 11 |
12 class CommandExecutor; | 12 class CommandExecutor; |
13 | 13 |
14 // Inits the command executor. Must be called before |ExecuteCommand|. | 14 // Inits the command executor. Must be called before |ExecuteCommand|. |
| 15 // This may be called during DLL load on Windows. |
15 void Init(scoped_ptr<CommandExecutor> executor); | 16 void Init(scoped_ptr<CommandExecutor> executor); |
16 | 17 |
17 // Synchronously executes the given command. Thread safe. | 18 // Synchronously executes the given command. Thread safe. |
18 // Command must be a JSON object: | 19 // Command must be a JSON object: |
19 // { | 20 // { |
20 // "name": <string>, | 21 // "name": <string>, |
21 // "parameters": <dictionary>, | 22 // "parameters": <dictionary>, |
22 // "sessionId": <string> | 23 // "sessionId": <string> |
23 // } | 24 // } |
24 // Response will always be a JSON object: | 25 // Response will always be a JSON object: |
25 // { | 26 // { |
26 // "status": <integer>, | 27 // "status": <integer>, |
27 // "value": <object>, | 28 // "value": <object>, |
28 // "sessionId": <string> | 29 // "sessionId": <string> |
29 // } | 30 // } |
30 // If "status" is non-zero, "value" will be an object with a string "message" | 31 // If "status" is non-zero, "value" will be an object with a string "message" |
31 // property which signifies the error message. | 32 // property which signifies the error message. |
32 void ExecuteCommand(const std::string& command, std::string* response); | 33 void ExecuteCommand(const std::string& command, std::string* response); |
33 | 34 |
34 // Shuts down the command executor. No commands must be currently executing. | 35 // Shuts down the command executor. No commands must be currently executing. |
35 void Shutdown(); | 36 void Shutdown(); |
36 | 37 |
37 #endif // CHROME_TEST_CHROMEDRIVER_CHROMEDRIVER_H_ | 38 #endif // CHROME_TEST_CHROMEDRIVER_CHROMEDRIVER_H_ |
OLD | NEW |