Chromium Code Reviews| Index: chrome/test/remoting/remote_desktop_browsertest.cc |
| diff --git a/chrome/test/remoting/remote_desktop_browsertest.cc b/chrome/test/remoting/remote_desktop_browsertest.cc |
| index 5ca641e2fbd68d1ef5ab386bc393f09a7ed135f7..8ec9267e14e95bf7aadbafba47b0c8aaa81495a5 100644 |
| --- a/chrome/test/remoting/remote_desktop_browsertest.cc |
| +++ b/chrome/test/remoting/remote_desktop_browsertest.cc |
| @@ -707,12 +707,19 @@ void RemoteDesktopBrowserTest::RunJavaScriptTest( |
| void RemoteDesktopBrowserTest::ClickOnControl(const std::string& name) { |
| ASSERT_TRUE(HtmlElementVisible(name)); |
| - ConditionalTimeoutWaiter waiter( |
| - base::TimeDelta::FromSeconds(5), |
| - base::TimeDelta::FromMilliseconds(500), |
| - base::Bind(&RemoteDesktopBrowserTest::IsEnabled, |
| - active_web_contents(), name)); |
| - ASSERT_TRUE(waiter.Wait()); |
| + std::string has_disabled_attribute = |
| + "document.getElementById('" + name + "').hasAttribute('disabled')"; |
| + |
| + if (ExecuteScriptAndExtractBool(active_web_contents(), |
| + has_disabled_attribute)) { |
|
Jamie
2014/09/19 22:37:23
Nit: Indent the second and subsequent parameters t
anandc
2014/09/19 22:45:05
Done.
|
| + // 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();"); |
| } |