Commit b1e52a1f authored by Ryan Sturm's avatar Ryan Sturm Committed by Commit Bot

Making flaky test consistent with non-flaky tests

The flake is due to click happening before layout meaning the click
message happens before the onLoad message. This switches the order
of a WaitForLayout and RunUntilIdle pair of calls.

Bug: None
Change-Id: Icc52d88317521ac584d92576be41d9ebfea9a638
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611916
Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659636}
parent a2ce45b0
...@@ -318,12 +318,12 @@ IN_PROC_BROWSER_TEST_F( ...@@ -318,12 +318,12 @@ IN_PROC_BROWSER_TEST_F(
const GURL& url = GetTestURL("/page_with_same_host_anchor_element.html"); const GURL& url = GetTestURL("/page_with_same_host_anchor_element.html");
ui_test_utils::NavigateToURL(browser(), url); ui_test_utils::NavigateToURL(browser(), url);
base::RunLoop().RunUntilIdle(); WaitForLayout(&histogram_tester);
EXPECT_TRUE(content::ExecuteScript( EXPECT_TRUE(content::ExecuteScript(
browser()->tab_strip_model()->GetActiveWebContents(), browser()->tab_strip_model()->GetActiveWebContents(),
"document.getElementById('google').click();")); "document.getElementById('google').click();"));
WaitForLayout(&histogram_tester); base::RunLoop().RunUntilIdle();
histogram_tester.ExpectUniqueSample( histogram_tester.ExpectUniqueSample(
"AnchorElementMetrics.Visible.NumberOfAnchorElements", 2, 1); "AnchorElementMetrics.Visible.NumberOfAnchorElements", 2, 1);
......
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