Commit 725e8d6e authored by anandc's avatar anandc Committed by Commit bot

Some controls do not have a disabled property. Skip checking for disabled before clicking them.

BUG=415683

Review URL: https://codereview.chromium.org/582833003

Cr-Commit-Position: refs/heads/master@{#295833}
parent fe2ec8ff
...@@ -707,12 +707,19 @@ void RemoteDesktopBrowserTest::RunJavaScriptTest( ...@@ -707,12 +707,19 @@ void RemoteDesktopBrowserTest::RunJavaScriptTest(
void RemoteDesktopBrowserTest::ClickOnControl(const std::string& name) { void RemoteDesktopBrowserTest::ClickOnControl(const std::string& name) {
ASSERT_TRUE(HtmlElementVisible(name)); ASSERT_TRUE(HtmlElementVisible(name));
ConditionalTimeoutWaiter waiter( std::string has_disabled_attribute =
base::TimeDelta::FromSeconds(5), "document.getElementById('" + name + "').hasAttribute('disabled')";
base::TimeDelta::FromMilliseconds(500),
base::Bind(&RemoteDesktopBrowserTest::IsEnabled, if (ExecuteScriptAndExtractBool(active_web_contents(),
active_web_contents(), name)); has_disabled_attribute)) {
ASSERT_TRUE(waiter.Wait()); // This element has a disabled attribute. Wait for it become enabled.
ConditionalTimeoutWaiter waiter(
base::TimeDelta::FromSeconds(5),
base::TimeDelta::FromMilliseconds(500),
base::Bind(&RemoteDesktopBrowserTest::IsEnabled,
active_web_contents(), name));
ASSERT_TRUE(waiter.Wait());
}
ExecuteScript("document.getElementById(\"" + name + "\").click();"); ExecuteScript("document.getElementById(\"" + name + "\").click();");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment