Commit 40aa799e authored by Marina Ciocea's avatar Marina Ciocea Committed by Commit Bot

Revert "Re-enable AccessibilityFocusHighlightBrowserTest.DrawsHighlight"

This reverts commit a9af8d92.

Reason for revert: Test still flakes: https://ci.chromium.org/p/chromium/builders/ci/Mac10.12%20Tests/34553

Original change's description:
> Re-enable AccessibilityFocusHighlightBrowserTest.DrawsHighlight
> 
> It flaked on Mac due to slightly more than 0.01% of pixels in the
> page already having the focus highlight color.
> 
> I updated the numbers to be more robust, with more margin for
> deviations that will still allow it to pass. By making the
> input element taller, that means more pixels get the focus
> highlight color.
> 
> Bug: 1083806, 1021939
> Change-Id: I34787ab08eedaaba9dde2cc960b0ab948e711a3d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209683
> Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
> Reviewed-by: Chris Hall <chrishall@chromium.org>
> Commit-Queue: Chris Hall <chrishall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#771512}

TBR=dmazzoni@chromium.org,chrishall@chromium.org

Change-Id: Ia6a57b4e08cc2341464e2bec788d6a7fe97d4334
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1083806, 1021939
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2215042Reviewed-by: default avatarMarina Ciocea <marinaciocea@chromium.org>
Commit-Queue: Marina Ciocea <marinaciocea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771554}
parent 2cc914aa
......@@ -115,12 +115,19 @@ class AccessibilityFocusHighlightBrowserTest : public InProcessBrowserTest {
// Smoke test that ensures that when a node gets focus, the layer with the
// focus highlight actually gets drawn.
IN_PROC_BROWSER_TEST_F(AccessibilityFocusHighlightBrowserTest, DrawsHighlight) {
//
// Flaky on Mac. TODO(crbug.com/1083806): Enable this test.
#if defined(OS_MACOSX)
#define MAYBE_DrawsHighlight DISABLED_DrawsHighlight
#else
#define MAYBE_DrawsHighlight DrawsHighlight
#endif
IN_PROC_BROWSER_TEST_F(AccessibilityFocusHighlightBrowserTest,
MAYBE_DrawsHighlight) {
ui_test_utils::NavigateToURL(
browser(), GURL("data:text/html,"
"<body style='background-color: rgb(204, 255, 255)'>"
"<input id='textfield' "
" style='width: 100%; height: 100px;'>"));
"<input id='textfield' style='width: 100%'>"));
AccessibilityFocusHighlight::SetNoFadeForTesting();
AccessibilityFocusHighlight::SkipActivationCheckForTesting();
......@@ -132,13 +139,13 @@ IN_PROC_BROWSER_TEST_F(AccessibilityFocusHighlightBrowserTest, DrawsHighlight) {
base::RunLoop().RunUntilIdle();
image = CaptureWindowContents();
} while (CountPercentPixelsWithColor(image, SkColorSetRGB(204, 255, 255)) <
80.0f);
90.0f);
// Initially less than 0.02% of the image should be the focus ring's highlight
// Initially less than 0.01% of the image should be the focus ring's highlight
// color.
SkColor highlight_color =
AccessibilityFocusHighlight::GetHighlightColorForTesting();
ASSERT_LT(CountPercentPixelsWithColor(image, highlight_color), 0.02f);
ASSERT_LT(CountPercentPixelsWithColor(image, highlight_color), 0.01f);
// Focus something.
content::WebContents* web_contents =
......@@ -146,10 +153,10 @@ IN_PROC_BROWSER_TEST_F(AccessibilityFocusHighlightBrowserTest, DrawsHighlight) {
std::string script("document.getElementById('textfield').focus();");
EXPECT_TRUE(content::ExecuteScript(web_contents, script));
// Now wait until at least 0.5% of the image has the focus ring's highlight
// Now wait until at least 0.1% of the image has the focus ring's highlight
// color. If it never does, the test will time out.
do {
base::RunLoop().RunUntilIdle();
image = CaptureWindowContents();
} while (CountPercentPixelsWithColor(image, highlight_color) < 0.5f);
} while (CountPercentPixelsWithColor(image, highlight_color) < 0.1f);
}
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