Index: chrome/test/webdriver/commands/webelement_commands.cc |
diff --git a/chrome/test/webdriver/commands/webelement_commands.cc b/chrome/test/webdriver/commands/webelement_commands.cc |
index 9471e4be47cd0b93362798336d8fc23de01d587e..b956a4e7493d4bb5b4286981ae0b2f72c84fc418 100644 |
--- a/chrome/test/webdriver/commands/webelement_commands.cc |
+++ b/chrome/test/webdriver/commands/webelement_commands.cc |
@@ -155,16 +155,12 @@ bool ElementDisplayedCommand::DoesGet() { |
} |
void ElementDisplayedCommand::ExecuteGet(Response* const response) { |
- scoped_ptr<ListValue> args(new ListValue); |
- args->Append(element.ToValue()); |
- |
- std::string script = base::StringPrintf( |
- "return (%s).apply(null, arguments);", atoms::IS_DISPLAYED); |
- |
- Value* result = NULL; |
- ErrorCode status = session_->ExecuteScript(script, args.get(), &result); |
+ bool is_displayed; |
+ ErrorCode status = session_->IsElementDisplayed( |
+ session_->current_target(), element, &is_displayed); |
+ if (status == kSuccess) |
+ response->SetValue(Value::CreateBooleanValue(is_displayed)); |
response->SetStatus(status); |
- response->SetValue(result); |
} |
///////////////////// ElementEnabledCommand //////////////////// |