| OLD | NEW |
| 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/memory/scoped_ptr.h" | 8 #include "base/memory/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 Loading... |
| 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 SendCaptureEntirePageJSONRequest( |
| 200 AutomationMessageSender* sender, |
| 201 int browser_index, |
| 202 int tab_index, |
| 203 const FilePath& path) { |
| 204 DictionaryValue dict; |
| 205 dict.SetString("command", "CaptureEntirePage"); |
| 206 dict.SetInteger("windex", browser_index); |
| 207 dict.SetInteger("tab_index", tab_index); |
| 208 dict.SetString("path", path.value()); |
| 209 DictionaryValue reply_dict; |
| 210 |
| 211 return SendAutomationJSONRequest(sender, dict, &reply_dict); |
| 212 } |
| 213 |
| 198 bool SendGetTabURLJSONRequest( | 214 bool SendGetTabURLJSONRequest( |
| 199 AutomationMessageSender* sender, | 215 AutomationMessageSender* sender, |
| 200 int browser_index, | 216 int browser_index, |
| 201 int tab_index, | 217 int tab_index, |
| 202 std::string* url) { | 218 std::string* url) { |
| 203 DictionaryValue dict; | 219 DictionaryValue dict; |
| 204 dict.SetString("command", "GetTabURL"); | 220 dict.SetString("command", "GetTabURL"); |
| 205 dict.SetInteger("windex", browser_index); | 221 dict.SetInteger("windex", browser_index); |
| 206 dict.SetInteger("tab_index", tab_index); | 222 dict.SetInteger("tab_index", tab_index); |
| 207 DictionaryValue reply_dict; | 223 DictionaryValue reply_dict; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 return SendAutomationJSONRequest(sender, dict, &reply_dict); | 449 return SendAutomationJSONRequest(sender, dict, &reply_dict); |
| 434 } | 450 } |
| 435 | 451 |
| 436 bool SendWaitForAllTabsToStopLoadingJSONRequest( | 452 bool SendWaitForAllTabsToStopLoadingJSONRequest( |
| 437 AutomationMessageSender* sender) { | 453 AutomationMessageSender* sender) { |
| 438 DictionaryValue dict; | 454 DictionaryValue dict; |
| 439 dict.SetString("command", "WaitForAllTabsToStopLoading"); | 455 dict.SetString("command", "WaitForAllTabsToStopLoading"); |
| 440 DictionaryValue reply_dict; | 456 DictionaryValue reply_dict; |
| 441 return SendAutomationJSONRequest(sender, dict, &reply_dict); | 457 return SendAutomationJSONRequest(sender, dict, &reply_dict); |
| 442 } | 458 } |
| OLD | NEW |