| 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..1f4e4dd6beb68641e456d0f15f8673e3b50c1ed1 100644
|
| --- a/chrome/test/webdriver/commands/webelement_commands.cc
|
| +++ b/chrome/test/webdriver/commands/webelement_commands.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -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 ////////////////////
|
|
|