Commit b1ce4a4e authored by Yu Han's avatar Yu Han Committed by Chromium LUCI CQ

Reland "[Controls Refresh Android] Fixes input missing border"

This is a reland of 909901eb

The revert was due to greater pixels error difference between
Mac 10.12 & 10.15 and the baseline.

After checking the error rate on failed Mac bots, the fix is
to increase the error_pixels_percentage_limit from 9f to 10.2f in
form_controls_browsertest::FuzzyPixelComparator.

Original change's description:
> [Controls Refresh Android] Fixes input missing border
>
> Prior to this CL, controls-refresh text input is missing its border.
>
> The fix is to make sure property text_field.has_border is passed to
> native theme. This property is only used by form controls-refresh
> so it has no impact on existing text input.
>
> Bug: 1155397
> Change-Id: I3cacd4d9550e10388b15122d7ff94a32ffa5e39d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612495
> Reviewed-by: Camille Lamy <clamy@chromium.org>
> Reviewed-by: Mason Freed <masonfreed@chromium.org>
> Commit-Queue: Yu Han <yuzhehan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#841106}

Bug: 1155397, 1164011
Change-Id: I6f06173f677b45664ff4cb6dedfb9197b8ece95b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2618675Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Commit-Queue: Yu Han <yuzhehan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842590}
parent feda1504
......@@ -101,7 +101,7 @@ class FormControlsBrowserTest : public ContentBrowserTest {
// - Slight differences in radio and checkbox rendering in 10.15
cc::FuzzyPixelComparator comparator(
/* discard_alpha */ true,
/* error_pixels_percentage_limit */ 9.f,
/* error_pixels_percentage_limit */ 11.f,
/* small_error_pixels_percentage_limit */ 0.f,
/* avg_abs_error_limit */ 20.f,
/* max_abs_error_limit */ 79.f,
......@@ -158,6 +158,25 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Radio) {
/* screenshot_height */ 40);
}
IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Input) {
RunTest("form_controls_browsertest_input",
"<!-- text inputs -->"
"<style>input {width: 150px;}</style>"
"<input type=\"text\" /><br><br>"
"<input type=\"number\" /><br><br>"
"<input type=\"search\" /><br><br>"
"<input type=\"email\" /><br><br>"
"<input type=\"password\" /><br><br>"
"<!-- border -->"
"<input type=\"text\" style=\"border: 3px solid lime;\"/><br><br>"
"<!-- shadow -->"
"<input type=\"text\" style=\"box-shadow: 4px 4px 10px rgba(255,0,0,0.5), inset 4px 4px 4px rgba(0,255,0,0.5);\"/><br><br>"
"<!-- disabled -->"
"<input type=\"text\" disabled/>",
/* screenshot_width */ 200,
/* screenshot_height */ 330);
}
// TODO(jarhar): Add tests for other elements from
// https://concrete-hardboard.glitch.me
......
......@@ -59,6 +59,8 @@ static void GetNativeThemeExtraParams(
extra_params->text_field.is_listbox;
native_theme_extra_params->text_field.background_color =
extra_params->text_field.background_color;
native_theme_extra_params->text_field.has_border =
extra_params->text_field.has_border;
break;
case WebThemeEngine::kPartMenuList:
native_theme_extra_params->menu_list.has_border =
......
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