Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7236)

Unified Diff: chrome/test/remoting/remote_desktop_browsertest.cc

Issue 544403002: Fix Auth browser-test failure: make sure element is ready to receive click. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Assert if Accept button doesn't become active. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7966b5c183ab9d0e037fd1324fde844d4fd45e48..2a99abf53e56d8f8afbba145ab612d505ecfbc11 100644
--- a/chrome/test/remoting/remote_desktop_browsertest.cc
+++ b/chrome/test/remoting/remote_desktop_browsertest.cc
@@ -309,9 +309,8 @@ void RemoteDesktopBrowserTest::Approve() {
&RemoteDesktopBrowserTest::IsAuthenticatedInWindow,
browser()->tab_strip_model()->GetActiveWebContents()));
- ExecuteScript(
- "lso.approveButtonAction();"
- "document.forms[\"connect-approve\"].submit();");
+ // Click to Approve the web-app.
+ ClickOnControl("submit_approve_access");
observer.Wait();
@@ -708,6 +707,13 @@ 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());
+
ExecuteScript("document.getElementById(\"" + name + "\").click();");
}
@@ -801,4 +807,13 @@ bool RemoteDesktopBrowserTest::IsHostActionComplete(
host_action_var);
}
+// static
+bool RemoteDesktopBrowserTest::IsEnabled(
+ content::WebContents* client_web_content,
+ const std::string& element_name) {
+ return !ExecuteScriptAndExtractBool(
+ client_web_content,
+ "document.getElementById(\"" + element_name + "\").disabled");
+}
+
} // namespace remoting
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698