Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chrome/test/automation/automation_json_requests.cc

Issue 9288051: Implement the webdriver window sizing commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 ListValue* list_value = new ListValue(); 667 ListValue* list_value = new ListValue();
668 for (size_t path_index = 0; path_index < paths.size(); ++path_index) { 668 for (size_t path_index = 0; path_index < paths.size(); ++path_index) {
669 list_value->Append(Value::CreateStringValue(paths[path_index])); 669 list_value->Append(Value::CreateStringValue(paths[path_index]));
670 } 670 }
671 dict.Set("paths", list_value); 671 dict.Set("paths", list_value);
672 672
673 DictionaryValue reply_dict; 673 DictionaryValue reply_dict;
674 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); 674 return SendAutomationJSONRequest(sender, dict, &reply_dict, error);
675 } 675 }
676 676
677 bool SendSetViewBoundsJSONRequest(
678 AutomationMessageSender* sender,
679 const WebViewId& id,
680 int x,
681 int y,
682 int width,
683 int height,
684 automation::Error* error) {
685 DictionaryValue dict;
686 dict.SetString("command", "SetViewBounds");
687 id.UpdateDictionary(&dict, "auto_id");
688 dict.SetInteger("bounds.x", x);
689 dict.SetInteger("bounds.y", y);
690 dict.SetInteger("bounds.width", width);
691 dict.SetInteger("bounds.height", height);
692
693 DictionaryValue reply_dict;
694 return SendAutomationJSONRequest(sender, dict, &reply_dict, error);
695 }
696
677 bool SendGetAppModalDialogMessageJSONRequest( 697 bool SendGetAppModalDialogMessageJSONRequest(
678 AutomationMessageSender* sender, 698 AutomationMessageSender* sender,
679 std::string* message, 699 std::string* message,
680 Error* error) { 700 Error* error) {
681 DictionaryValue dict; 701 DictionaryValue dict;
682 dict.SetString("command", "GetAppModalDialogMessage"); 702 dict.SetString("command", "GetAppModalDialogMessage");
683 DictionaryValue reply_dict; 703 DictionaryValue reply_dict;
684 if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error)) 704 if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error))
685 return false; 705 return false;
686 return reply_dict.GetString("message", message); 706 return reply_dict.GetString("message", message);
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 base::Value* value, 881 base::Value* value,
862 Error* error) { 882 Error* error) {
863 DictionaryValue dict; 883 DictionaryValue dict;
864 dict.SetString("command", "SetPrefs"); 884 dict.SetString("command", "SetPrefs");
865 dict.SetInteger("windex", 0); 885 dict.SetInteger("windex", 0);
866 dict.SetString("path", pref); 886 dict.SetString("path", pref);
867 dict.Set("value", value); 887 dict.Set("value", value);
868 DictionaryValue reply_dict; 888 DictionaryValue reply_dict;
869 return SendAutomationJSONRequest(sender, dict, &reply_dict, error); 889 return SendAutomationJSONRequest(sender, dict, &reply_dict, error);
870 } 890 }
OLDNEW
« no previous file with comments | « chrome/test/automation/automation_json_requests.h ('k') | chrome/test/webdriver/commands/chrome_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698