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

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

Issue 5572001: Send screenshots back to the client for debugging (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: for review, still need to add a few more tests Created 9 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_path.h"
7 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
8 #include "base/values.h" 9 #include "base/values.h"
9 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 11 #include "base/json/json_writer.h"
11 #include "chrome/common/automation_messages.h" 12 #include "chrome/common/automation_messages.h"
12 #include "chrome/common/json_value_serializer.h" 13 #include "chrome/common/json_value_serializer.h"
13 #include "chrome/test/automation/automation_proxy.h" 14 #include "chrome/test/automation/automation_proxy.h"
14 15
15 namespace { 16 namespace {
16 17
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 int browser_index, 189 int browser_index,
189 int tab_index) { 190 int tab_index) {
190 DictionaryValue dict; 191 DictionaryValue dict;
191 dict.SetString("command", "Reload"); 192 dict.SetString("command", "Reload");
192 dict.SetInteger("windex", browser_index); 193 dict.SetInteger("windex", browser_index);
193 dict.SetInteger("tab_index", tab_index); 194 dict.SetInteger("tab_index", tab_index);
194 DictionaryValue reply_dict; 195 DictionaryValue reply_dict;
195 return SendAutomationJSONRequest(sender, dict, &reply_dict); 196 return SendAutomationJSONRequest(sender, dict, &reply_dict);
196 } 197 }
197 198
199 bool SendGetScreenShotJSONRequest(
200 AutomationMessageSender* sender,
201 int browser_index,
202 int tab_index,
203 const FilePath& path) {
204 DictionaryValue dict;
205 dict.SetString("command", "GetScreenShot");
206 dict.SetInteger("windex", browser_index);
207 dict.SetInteger("tab_index", tab_index);
208 dict.SetString("path", path.value());
209 DictionaryValue reply_dict;
210 return SendAutomationJSONRequest(sender, dict, &reply_dict);
kkania 2011/03/16 18:19:10 you need to check the value of the "success" key h
Joe 2011/03/17 00:15:25 Done.
211 }
212
198 bool SendGetTabURLJSONRequest( 213 bool SendGetTabURLJSONRequest(
199 AutomationMessageSender* sender, 214 AutomationMessageSender* sender,
200 int browser_index, 215 int browser_index,
201 int tab_index, 216 int tab_index,
202 std::string* url) { 217 std::string* url) {
203 DictionaryValue dict; 218 DictionaryValue dict;
204 dict.SetString("command", "GetTabURL"); 219 dict.SetString("command", "GetTabURL");
205 dict.SetInteger("windex", browser_index); 220 dict.SetInteger("windex", browser_index);
206 dict.SetInteger("tab_index", tab_index); 221 dict.SetInteger("tab_index", tab_index);
207 DictionaryValue reply_dict; 222 DictionaryValue reply_dict;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 return SendAutomationJSONRequest(sender, dict, &reply_dict); 404 return SendAutomationJSONRequest(sender, dict, &reply_dict);
390 } 405 }
391 406
392 bool SendWaitForAllTabsToStopLoadingJSONRequest( 407 bool SendWaitForAllTabsToStopLoadingJSONRequest(
393 AutomationMessageSender* sender) { 408 AutomationMessageSender* sender) {
394 DictionaryValue dict; 409 DictionaryValue dict;
395 dict.SetString("command", "WaitForAllTabsToStopLoading"); 410 dict.SetString("command", "WaitForAllTabsToStopLoading");
396 DictionaryValue reply_dict; 411 DictionaryValue reply_dict;
397 return SendAutomationJSONRequest(sender, dict, &reply_dict); 412 return SendAutomationJSONRequest(sender, dict, &reply_dict);
398 } 413 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698