diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-25 22:40:46 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-25 22:40:46 +0000 |
commit | 86a5293ac4571cffb0c7bb7f2da50f91ce6db829 (patch) | |
tree | 553291ff087abf82fc81e450a4fd989b134f48b5 | |
parent | de8d613db2b9815b7c15fb2924dea1852ddd31e4 (diff) | |
download | chromium_src-86a5293ac4571cffb0c7bb7f2da50f91ce6db829.zip chromium_src-86a5293ac4571cffb0c7bb7f2da50f91ce6db829.tar.gz chromium_src-86a5293ac4571cffb0c7bb7f2da50f91ce6db829.tar.bz2 |
(Hopefully) fix flakiness for AutoFillTest.BasicFormFill
The thinking is that the JavaScript call to focus() actually focuses the field asynchronously, so we should be waiting for the onFocus() event handler to fire rather than just marching ahead once focus() returns.
BUG=57962
TEST=interactive_ui_tests --gtest_filter=AutoFillTest.*BasicFormFill
Review URL: http://codereview.chromium.org/4066002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63794 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/autofill/autofill_browsertest.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index 527cccd..4c80100c 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -59,13 +59,7 @@ class AutoFillTest : public InProcessBrowserTest { }; // Test that basic form fill is working. -// FAILS on windows: http://crbug.com/57962 -#if defined(OS_WIN) -#define MAYBE_BasicFormFill DISABLED_BasicFormFill -#else -#define MAYBE_BasicFormFill BasicFormFill -#endif -IN_PROC_BROWSER_TEST_F(AutoFillTest, MAYBE_BasicFormFill) { +IN_PROC_BROWSER_TEST_F(AutoFillTest, BasicFormFill) { SetUpProfile(); ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); @@ -73,7 +67,9 @@ IN_PROC_BROWSER_TEST_F(AutoFillTest, MAYBE_BasicFormFill) { browser(), GURL("data:text/html;charset=utf-8," "<form action=\"http://www.google.com/\" method=\"POST\">" "<label for=\"firstname\">First name:</label>" - " <input type=\"text\" id=\"firstname\" /><br />" + " <input type=\"text\" id=\"firstname\"" + " onFocus=\"domAutomationController.send(true)\"" + " /><br />" "<label for=\"lastname\">Last name:</label>" " <input type=\"text\" id=\"lastname\" /><br />" "<label for=\"address1\">Address line 1:</label>" @@ -107,8 +103,11 @@ IN_PROC_BROWSER_TEST_F(AutoFillTest, MAYBE_BasicFormFill) { RenderViewHost* render_view_host = browser()->GetSelectedTabContents()->render_view_host(); - ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( - render_view_host, L"", L"document.getElementById('firstname').focus();")); + bool result; + ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( + render_view_host, L"", L"document.getElementById('firstname').focus();", + &result)); + ASSERT_TRUE(result); // Start filling the first name field with "M" and wait for the popup to be // shown. |