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/dom_element_proxy.h" | 5 #include "chrome/test/automation/dom_element_proxy.h" |
6 | 6 |
7 #include "chrome/test/automation/javascript_execution_controller.h" | 7 #include "chrome/test/automation/javascript_execution_controller.h" |
8 #include "chrome/test/automation/javascript_message_utils.h" | 8 #include "chrome/test/automation/javascript_message_utils.h" |
9 | 9 |
10 using javascript_utils::JavaScriptPrintf; | 10 using javascript_utils::JavaScriptPrintf; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 const char* script = "domAutomation.getAttribute(" | 215 const char* script = "domAutomation.getAttribute(" |
216 "domAutomation.getObject(%s), %s);"; | 216 "domAutomation.getObject(%s), %s);"; |
217 return executor_->ExecuteJavaScriptAndGetReturn( | 217 return executor_->ExecuteJavaScriptAndGetReturn( |
218 JavaScriptPrintf(script, this->handle(), attribute), out); | 218 JavaScriptPrintf(script, this->handle(), attribute), out); |
219 } | 219 } |
220 | 220 |
221 bool DOMElementProxy::GetText(std::string* text) { | 221 bool DOMElementProxy::GetText(std::string* text) { |
222 return GetValue("text", text); | 222 return GetValue("text", text); |
223 } | 223 } |
224 | 224 |
| 225 bool DOMElementProxy::GetInnerText(std::string* text) { |
| 226 return GetValue("innertext", text); |
| 227 } |
| 228 |
225 bool DOMElementProxy::GetInnerHTML(std::string* html) { | 229 bool DOMElementProxy::GetInnerHTML(std::string* html) { |
226 return GetValue("innerhtml", html); | 230 return GetValue("innerhtml", html); |
227 } | 231 } |
228 | 232 |
229 bool DOMElementProxy::GetId(std::string* id) { | 233 bool DOMElementProxy::GetId(std::string* id) { |
230 return GetValue("id", id); | 234 return GetValue("id", id); |
231 } | 235 } |
232 | 236 |
233 bool DOMElementProxy::GetName(std::string* name) { | 237 bool DOMElementProxy::GetName(std::string* name) { |
234 return GetAttribute("name", name); | 238 return GetAttribute("name", name); |
(...skipping 19 matching lines...) Expand all Loading... |
254 return false; | 258 return false; |
255 } | 259 } |
256 if (!is_valid()) | 260 if (!is_valid()) |
257 return false; | 261 return false; |
258 | 262 |
259 const char* script = "domAutomation.getValue(" | 263 const char* script = "domAutomation.getValue(" |
260 "domAutomation.getObject(%s), %s);"; | 264 "domAutomation.getObject(%s), %s);"; |
261 return executor_->ExecuteJavaScriptAndGetReturn( | 265 return executor_->ExecuteJavaScriptAndGetReturn( |
262 JavaScriptPrintf(script, this->handle(), type), value); | 266 JavaScriptPrintf(script, this->handle(), type), value); |
263 } | 267 } |
OLD | NEW |