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_AUTOMATION_AUTOMATION_JSON_REQUESTS_H_ | 5 #ifndef CHROME_TEST_AUTOMATION_AUTOMATION_JSON_REQUESTS_H_ |
6 #define CHROME_TEST_AUTOMATION_AUTOMATION_JSON_REQUESTS_H_ | 6 #define CHROME_TEST_AUTOMATION_AUTOMATION_JSON_REQUESTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
14 #include "chrome/common/automation_constants.h" | 15 #include "chrome/common/automation_constants.h" |
15 #include "chrome/common/automation_id.h" | 16 #include "chrome/common/automation_id.h" |
16 #include "ui/base/keycodes/keyboard_codes.h" | 17 #include "ui/base/keycodes/keyboard_codes.h" |
17 | 18 |
18 class AutomationMessageSender; | 19 class AutomationMessageSender; |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class DictionaryValue; | 22 class DictionaryValue; |
22 class FilePath; | 23 class FilePath; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // navigations to complete. Returns true on success. | 201 // navigations to complete. Returns true on success. |
201 bool SendNavigateToURLJSONRequest( | 202 bool SendNavigateToURLJSONRequest( |
202 AutomationMessageSender* sender, | 203 AutomationMessageSender* sender, |
203 const WebViewLocator& locator, | 204 const WebViewLocator& locator, |
204 const std::string& url, | 205 const std::string& url, |
205 int navigation_count, | 206 int navigation_count, |
206 AutomationMsg_NavigationResponseValues* nav_response, | 207 AutomationMsg_NavigationResponseValues* nav_response, |
207 automation::Error* error) WARN_UNUSED_RESULT; | 208 automation::Error* error) WARN_UNUSED_RESULT; |
208 | 209 |
209 // Requests the given javascript to be executed in the frame specified by the | 210 // Requests the given javascript to be executed in the frame specified by the |
210 // given xpath. Returns true on success. If true, |result| will be set to the | 211 // given xpath. Returns true on success. If true, |result| will be reset to the |
211 // result of the execution and ownership will be given to the caller. | 212 // result of the execution. |
212 bool SendExecuteJavascriptJSONRequest( | 213 bool SendExecuteJavascriptJSONRequest( |
213 AutomationMessageSender* sender, | 214 AutomationMessageSender* sender, |
214 const WebViewLocator& locator, | 215 const WebViewLocator& locator, |
215 const std::string& frame_xpath, | 216 const std::string& frame_xpath, |
216 const std::string& javascript, | 217 const std::string& javascript, |
217 base::Value** result, | 218 scoped_ptr<base::Value>* result, |
218 automation::Error* error) WARN_UNUSED_RESULT; | 219 automation::Error* error) WARN_UNUSED_RESULT; |
219 | 220 |
220 // Requests the specified view to go forward. Waits for the load to complete. | 221 // Requests the specified view to go forward. Waits for the load to complete. |
221 // Returns true on success. | 222 // Returns true on success. |
222 bool SendGoForwardJSONRequest( | 223 bool SendGoForwardJSONRequest( |
223 AutomationMessageSender* sender, | 224 AutomationMessageSender* sender, |
224 const WebViewLocator& locator, | 225 const WebViewLocator& locator, |
225 automation::Error* error) WARN_UNUSED_RESULT; | 226 automation::Error* error) WARN_UNUSED_RESULT; |
226 | 227 |
227 // Requests the specified view to go back. Waits for the load to complete. | 228 // Requests the specified view to go back. Waits for the load to complete. |
(...skipping 30 matching lines...) Expand all Loading... |
258 const std::string& reason, | 259 const std::string& reason, |
259 automation::Error* error) WARN_UNUSED_RESULT; | 260 automation::Error* error) WARN_UNUSED_RESULT; |
260 #endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | 261 #endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) |
261 | 262 |
262 // Requests all the cookies for the given URL. On success returns true and | 263 // Requests all the cookies for the given URL. On success returns true and |
263 // caller takes ownership of |cookies|, which is a list of all the cookies in | 264 // caller takes ownership of |cookies|, which is a list of all the cookies in |
264 // dictionary format. | 265 // dictionary format. |
265 bool SendGetCookiesJSONRequest( | 266 bool SendGetCookiesJSONRequest( |
266 AutomationMessageSender* sender, | 267 AutomationMessageSender* sender, |
267 const std::string& url, | 268 const std::string& url, |
268 base::ListValue** cookies, | 269 scoped_ptr<base::ListValue>* cookies, |
269 automation::Error* error) WARN_UNUSED_RESULT; | 270 automation::Error* error) WARN_UNUSED_RESULT; |
270 | 271 |
271 // Requests deletion of the cookie with the given name and URL. Returns true | 272 // Requests deletion of the cookie with the given name and URL. Returns true |
272 // on success. | 273 // on success. |
273 bool SendDeleteCookieJSONRequest( | 274 bool SendDeleteCookieJSONRequest( |
274 AutomationMessageSender* sender, | 275 AutomationMessageSender* sender, |
275 const std::string& url, | 276 const std::string& url, |
276 const std::string& cookie_name, | 277 const std::string& cookie_name, |
277 automation::Error* error) WARN_UNUSED_RESULT; | 278 automation::Error* error) WARN_UNUSED_RESULT; |
278 | 279 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 base::Value* value, | 530 base::Value* value, |
530 automation::Error* error) WARN_UNUSED_RESULT; | 531 automation::Error* error) WARN_UNUSED_RESULT; |
531 | 532 |
532 // Requests to override the user's geolocation. Returns true on success. | 533 // Requests to override the user's geolocation. Returns true on success. |
533 bool SendOverrideGeolocationJSONRequest( | 534 bool SendOverrideGeolocationJSONRequest( |
534 AutomationMessageSender* sender, | 535 AutomationMessageSender* sender, |
535 const base::DictionaryValue* geolocation, | 536 const base::DictionaryValue* geolocation, |
536 automation::Error* error) WARN_UNUSED_RESULT; | 537 automation::Error* error) WARN_UNUSED_RESULT; |
537 | 538 |
538 #endif // CHROME_TEST_AUTOMATION_AUTOMATION_JSON_REQUESTS_H_ | 539 #endif // CHROME_TEST_AUTOMATION_AUTOMATION_JSON_REQUESTS_H_ |
OLD | NEW |