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 #include "chrome/test/automation/automation_json_requests.h" | 5 #include "chrome/test/automation/automation_json_requests.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 AutomationMessageSender* sender, | 341 AutomationMessageSender* sender, |
342 const WebViewLocator& locator, | 342 const WebViewLocator& locator, |
343 Error* error) { | 343 Error* error) { |
344 DictionaryValue dict; | 344 DictionaryValue dict; |
345 dict.SetString("command", "Reload"); | 345 dict.SetString("command", "Reload"); |
346 locator.UpdateDictionary(&dict, "auto_id"); | 346 locator.UpdateDictionary(&dict, "auto_id"); |
347 DictionaryValue reply_dict; | 347 DictionaryValue reply_dict; |
348 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); | 348 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); |
349 } | 349 } |
350 | 350 |
351 bool SendCaptureEntirePageJSONRequest( | 351 bool SendCaptureEntirePageJSONRequestDeprecated( |
352 AutomationMessageSender* sender, | 352 AutomationMessageSender* sender, |
353 const WebViewLocator& locator, | 353 const WebViewLocator& locator, |
354 const base::FilePath& path, | 354 const base::FilePath& path, |
355 Error* error) { | 355 Error* error) { |
356 DictionaryValue dict; | 356 DictionaryValue dict; |
357 dict.SetString("command", "CaptureEntirePage"); | 357 dict.SetString("command", "CaptureEntirePage"); |
358 locator.UpdateDictionary(&dict, "auto_id"); | 358 locator.UpdateDictionary(&dict, "auto_id"); |
359 dict.SetString("path", path.value()); | 359 dict.SetString("path", path.value()); |
360 DictionaryValue reply_dict; | 360 DictionaryValue reply_dict; |
361 | 361 |
362 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); | 362 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); |
363 } | 363 } |
364 | 364 |
365 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | 365 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) |
366 bool SendHeapProfilerDumpJSONRequest( | 366 bool SendHeapProfilerDumpJSONRequestDeprecated( |
367 AutomationMessageSender* sender, | 367 AutomationMessageSender* sender, |
368 const WebViewLocator& locator, | 368 const WebViewLocator& locator, |
369 const std::string& reason, | 369 const std::string& reason, |
370 Error* error) { | 370 Error* error) { |
371 DictionaryValue dict; | 371 DictionaryValue dict; |
372 dict.SetString("command", "HeapProfilerDump"); | 372 dict.SetString("command", "HeapProfilerDump"); |
373 dict.SetString("process_type", "renderer"); | 373 dict.SetString("process_type", "renderer"); |
374 dict.SetString("reason", reason); | 374 dict.SetString("reason", reason); |
375 locator.UpdateDictionary(&dict, "auto_id"); | 375 locator.UpdateDictionary(&dict, "auto_id"); |
376 DictionaryValue reply_dict; | 376 DictionaryValue reply_dict; |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 Error* error) { | 647 Error* error) { |
648 DictionaryValue dict; | 648 DictionaryValue dict; |
649 dict.SetString("command", "SendOSLevelKeyEventToTab"); | 649 dict.SetString("command", "SendOSLevelKeyEventToTab"); |
650 locator.UpdateDictionary(&dict, "auto_id"); | 650 locator.UpdateDictionary(&dict, "auto_id"); |
651 dict.SetInteger("keyCode", key_code); | 651 dict.SetInteger("keyCode", key_code); |
652 dict.SetInteger("modifiers", modifiers); | 652 dict.SetInteger("modifiers", modifiers); |
653 DictionaryValue reply_dict; | 653 DictionaryValue reply_dict; |
654 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); | 654 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); |
655 } | 655 } |
656 | 656 |
657 bool SendWebMouseEventJSONRequest( | 657 bool SendWebMouseEventJSONRequestDeprecated( |
658 AutomationMessageSender* sender, | 658 AutomationMessageSender* sender, |
659 const WebViewLocator& locator, | 659 const WebViewLocator& locator, |
660 const WebMouseEvent& mouse_event, | 660 const WebMouseEvent& mouse_event, |
661 automation::Error* error) { | 661 automation::Error* error) { |
662 DictionaryValue dict; | 662 DictionaryValue dict; |
663 dict.SetString("command", "ProcessWebMouseEvent"); | 663 dict.SetString("command", "ProcessWebMouseEvent"); |
664 locator.UpdateDictionary(&dict, "auto_id"); | 664 locator.UpdateDictionary(&dict, "auto_id"); |
665 dict.SetInteger("type", mouse_event.type); | 665 dict.SetInteger("type", mouse_event.type); |
666 dict.SetInteger("button", mouse_event.button); | 666 dict.SetInteger("button", mouse_event.button); |
667 dict.SetInteger("x", mouse_event.x); | 667 dict.SetInteger("x", mouse_event.x); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 const std::string& prompt_text, | 755 const std::string& prompt_text, |
756 Error* error) { | 756 Error* error) { |
757 DictionaryValue dict; | 757 DictionaryValue dict; |
758 dict.SetString("command", "AcceptOrDismissAppModalDialog"); | 758 dict.SetString("command", "AcceptOrDismissAppModalDialog"); |
759 dict.SetBoolean("accept", true); | 759 dict.SetBoolean("accept", true); |
760 dict.SetString("prompt_text", prompt_text); | 760 dict.SetString("prompt_text", prompt_text); |
761 DictionaryValue reply_dict; | 761 DictionaryValue reply_dict; |
762 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); | 762 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); |
763 } | 763 } |
764 | 764 |
765 bool SendWaitForAllViewsToStopLoadingJSONRequest( | 765 bool SendWaitForAllViewsToStopLoadingJSONRequestDeprecated( |
766 AutomationMessageSender* sender, | 766 AutomationMessageSender* sender, |
767 Error* error) { | 767 Error* error) { |
768 DictionaryValue dict; | 768 DictionaryValue dict; |
769 dict.SetString("command", "WaitForAllTabsToStopLoading"); | 769 dict.SetString("command", "WaitForAllTabsToStopLoading"); |
770 DictionaryValue reply_dict; | 770 DictionaryValue reply_dict; |
771 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); | 771 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); |
772 } | 772 } |
773 | 773 |
774 bool SendGetChromeDriverAutomationVersion( | 774 bool SendGetChromeDriverAutomationVersion( |
775 AutomationMessageSender* sender, | 775 AutomationMessageSender* sender, |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 | 937 |
938 bool SendOverrideGeolocationJSONRequest( | 938 bool SendOverrideGeolocationJSONRequest( |
939 AutomationMessageSender* sender, | 939 AutomationMessageSender* sender, |
940 const base::DictionaryValue* geolocation, | 940 const base::DictionaryValue* geolocation, |
941 Error* error) { | 941 Error* error) { |
942 scoped_ptr<DictionaryValue> dict(geolocation->DeepCopy()); | 942 scoped_ptr<DictionaryValue> dict(geolocation->DeepCopy()); |
943 dict->SetString("command", "OverrideGeoposition"); | 943 dict->SetString("command", "OverrideGeoposition"); |
944 DictionaryValue reply_dict; | 944 DictionaryValue reply_dict; |
945 return SendAutomationJSONRequest(sender, *dict.get(), &reply_dict, error); | 945 return SendAutomationJSONRequest(sender, *dict.get(), &reply_dict, error); |
946 } | 946 } |
OLD | NEW |