Chromium Code Reviews| 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/file_path.h" | 8 #include "base/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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 705 id.UpdateDictionary(&dict, "auto_id"); | 705 id.UpdateDictionary(&dict, "auto_id"); |
| 706 dict.SetInteger("bounds.x", x); | 706 dict.SetInteger("bounds.x", x); |
| 707 dict.SetInteger("bounds.y", y); | 707 dict.SetInteger("bounds.y", y); |
| 708 dict.SetInteger("bounds.width", width); | 708 dict.SetInteger("bounds.width", width); |
| 709 dict.SetInteger("bounds.height", height); | 709 dict.SetInteger("bounds.height", height); |
| 710 | 710 |
| 711 DictionaryValue reply_dict; | 711 DictionaryValue reply_dict; |
| 712 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); | 712 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); |
| 713 } | 713 } |
| 714 | 714 |
| 715 bool SendMaximizeJSONRequest( | |
| 716 AutomationMessageSender* sender, | |
| 717 const WebViewId& id, | |
| 718 automation::Error* error) { | |
| 719 DictionaryValue dict; | |
| 720 dict.SetString("command", "Maximize"); | |
|
kkania
2012/05/23 17:49:20
This is different from what you had in testing_aut
zori
2012/05/24 00:39:33
True, that's how a unit test would have been usefu
| |
| 721 id.UpdateDictionary(&dict, "auto_id"); | |
| 722 | |
| 723 DictionaryValue reply_dict; | |
| 724 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); | |
| 725 } | |
| 726 | |
| 715 bool SendGetAppModalDialogMessageJSONRequest( | 727 bool SendGetAppModalDialogMessageJSONRequest( |
| 716 AutomationMessageSender* sender, | 728 AutomationMessageSender* sender, |
| 717 std::string* message, | 729 std::string* message, |
| 718 Error* error) { | 730 Error* error) { |
| 719 DictionaryValue dict; | 731 DictionaryValue dict; |
| 720 dict.SetString("command", "GetAppModalDialogMessage"); | 732 dict.SetString("command", "GetAppModalDialogMessage"); |
| 721 DictionaryValue reply_dict; | 733 DictionaryValue reply_dict; |
| 722 if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error)) | 734 if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error)) |
| 723 return false; | 735 return false; |
| 724 return reply_dict.GetString("message", message); | 736 return reply_dict.GetString("message", message); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 921 | 933 |
| 922 bool SendOverrideGeolocationJSONRequest( | 934 bool SendOverrideGeolocationJSONRequest( |
| 923 AutomationMessageSender* sender, | 935 AutomationMessageSender* sender, |
| 924 base::DictionaryValue* geolocation, | 936 base::DictionaryValue* geolocation, |
| 925 Error* error) { | 937 Error* error) { |
| 926 scoped_ptr<DictionaryValue> dict(geolocation->DeepCopy()); | 938 scoped_ptr<DictionaryValue> dict(geolocation->DeepCopy()); |
| 927 dict->SetString("command", "OverrideGeoposition"); | 939 dict->SetString("command", "OverrideGeoposition"); |
| 928 DictionaryValue reply_dict; | 940 DictionaryValue reply_dict; |
| 929 return SendAutomationJSONRequest(sender, *dict.get(), &reply_dict, error); | 941 return SendAutomationJSONRequest(sender, *dict.get(), &reply_dict, error); |
| 930 } | 942 } |
| OLD | NEW |