Skip to content

Commit

Permalink
Revert "Tighten fuzzy parameters in form_controls_browsertest.cc"
Browse files Browse the repository at this point in the history
This reverts commit 3fc2887.

Reason for revert:
  Original change touches FormControlsBrowserTest.*, which is failing
  on many Mac and Fuchsia builders:
  * https://ci.chromium.org/ui/p/chromium/builders/ci/fuchsia-arm64-cast-receiver-rel/3107/overview
  * https://ci.chromium.org/ui/p/chromium/builders/ci/fuchsia-x64-cast-receiver-rel/2977/overview
  * https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/31023/overview
  * https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/61108/overview
  * https://ci.chromium.org/ui/p/chromium/builders/ci/fuchsia-x64-rel/3114/overview
  * https://ci.chromium.org/ui/p/chromium/builders/ci/fuchsia-arm64-rel/3529/overview

Original change's description:
> Tighten fuzzy parameters in form_controls_browsertest.cc
>
> This is a followup of crrev.com/c/4184656 and crrev.com/c/4185898.
>
> Now form_controls_browsertest.cc tolerates fewer large error pixels
> and more small error pixels. The tolerances are updated based on
> try results, with baselines regenerated.
>
> form_controls_browsertest.cc is moved from content/browser to
> content/renderer because it tests renderer functionality. Also move
> function MacOSVersionSupportsDarkMode() into browser_test_utils.h and
> use it from both form_controls_browsertest.cc and
> focus_ring_browsertest.cc.
>
> Cq-Include-Trybots: luci.chromium.try:mac10.13-blink-rel,mac10.14-blink-rel,mac10.15-blink-rel
> Change-Id: I3ad18958917ea0280a18d842b8784a26faa497d3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4183008
> Reviewed-by: Joey Arhar <jarhar@chromium.org>
> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1098071}

Change-Id: Ia51f91c4726a78d2211d6aec32e6ce3c3498ac70
Cq-Include-Trybots: luci.chromium.try:mac10.13-blink-rel,mac10.14-blink-rel,mac10.15-blink-rel
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4198496
Commit-Queue: Jonathan Lee <jonathanjlee@google.com>
Auto-Submit: Jonathan Lee <jonathanjlee@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Jonathan Lee <jonathanjlee@google.com>
Cr-Commit-Position: refs/heads/main@{#1098143}
  • Loading branch information
jonathan-j-lee authored and Chromium LUCI CQ committed Jan 27, 2023
1 parent 17f56fc commit ada2293
Show file tree
Hide file tree
Showing 43 changed files with 81 additions and 60 deletions.
10 changes: 3 additions & 7 deletions chrome/browser/focus_ring_browsertest.cc
Expand Up @@ -7,6 +7,7 @@
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/test/pixel_comparator.h"
#include "chrome/browser/focus_ring_browsertest_mac.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/in_process_browser_test.h"
Expand Down Expand Up @@ -106,10 +107,6 @@ class FocusRingBrowserTest : public InProcessBrowserTest {
}
};

#if BUILDFLAG(IS_MAC)
using content::MacOSVersionSupportsDarkMode;
#endif

// TODO(crbug.com/1222757): Flaky on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_Checkbox DISABLED_Checkbox
Expand Down Expand Up @@ -201,9 +198,8 @@ IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, MAYBE_Anchor) {
#endif
IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, MAYBE_DarkModeButton) {
#if BUILDFLAG(IS_MAC)
if (!MacOSVersionSupportsDarkMode()) {
GTEST_SKIP();
}
if (!MacOSVersionSupportsDarkMode())
return;
auto comparator = mac_strict_comparator;
#else
cc::AlphaDiscardingExactPixelComparator comparator;
Expand Down
10 changes: 10 additions & 0 deletions chrome/browser/focus_ring_browsertest_mac.h
@@ -0,0 +1,10 @@
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_FOCUS_RING_BROWSERTEST_MAC_H_
#define CHROME_BROWSER_FOCUS_RING_BROWSERTEST_MAC_H_

bool MacOSVersionSupportsDarkMode();

#endif // CHROME_BROWSER_FOCUS_RING_BROWSERTEST_MAC_H_
11 changes: 11 additions & 0 deletions chrome/browser/focus_ring_browsertest_mac.mm
@@ -0,0 +1,11 @@
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/focus_ring_browsertest_mac.h"

bool MacOSVersionSupportsDarkMode() {
if (@available(macOS 10.14, *))
return true;
return false;
}
2 changes: 2 additions & 0 deletions chrome/test/BUILD.gn
Expand Up @@ -9900,6 +9900,8 @@ if (!is_android) {
"../browser/app_controller_mac_interactive_uitest.mm",
"../browser/apps/platform_apps/app_shim_interactive_uitest_mac.mm",
"../browser/apps/platform_apps/app_shim_quit_interactive_uitest_mac.mm",
"../browser/focus_ring_browsertest_mac.h",
"../browser/focus_ring_browsertest_mac.mm",
"../browser/global_keyboard_shortcuts_mac_browsertest.mm",
"../browser/notifications/notification_interactive_uitest_mac.mm",
"../browser/spellchecker/spellcheck_mac_view_interactive_uitest.mm",
Expand Down
Expand Up @@ -7,6 +7,7 @@
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/test/pixel_comparator.h"
#include "content/browser/form_controls_browsertest_mac.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
Expand Down Expand Up @@ -103,9 +104,9 @@ class FormControlsBrowserTest : public ContentBrowserTest {
// TODO(wangxianzhu): Tighten these parameters.
auto comparator = cc::FuzzyPixelComparator()
.DiscardAlpha()
.SetErrorPixelsPercentageLimit(5.f, 25.f)
.SetErrorPixelsPercentageLimit(26.f)
.SetAvgAbsErrorLimit(20.f)
.SetAbsErrorLimit(120, 2);
.SetAbsErrorLimit(120);
#elif BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || (OS_LINUX) || \
BUILDFLAG(IS_FUCHSIA)
// Different versions of android may have slight differences in rendering.
Expand All @@ -115,9 +116,9 @@ class FormControlsBrowserTest : public ContentBrowserTest {
// This also applies to different versions of other OSes.
auto comparator = cc::FuzzyPixelComparator()
.DiscardAlpha()
.SetErrorPixelsPercentageLimit(1.f, 2.f)
.SetErrorPixelsPercentageLimit(11.f)
.SetAvgAbsErrorLimit(5.f)
.SetAbsErrorLimit(10, 2);
.SetAbsErrorLimit(140);
#else
cc::AlphaDiscardingExactPixelComparator comparator;
#endif
Expand Down Expand Up @@ -149,9 +150,8 @@ class FormControlsBrowserTest : public ContentBrowserTest {
#endif

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MAYBE_Checkbox) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_checkbox",
"<input type=checkbox>"
Expand All @@ -167,9 +167,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MAYBE_Checkbox) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Radio) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_radio",
"<input type=radio>"
Expand All @@ -186,14 +185,12 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Radio) {

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, DarkModeTextSelection) {
#if BUILDFLAG(IS_MAC)
if (!MacOSVersionSupportsDarkMode()) {
GTEST_SKIP();
}
if (!MacOSVersionSupportsDarkMode())
return;
#endif

if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_dark_mode_text_selection",
"<meta name=\"color-scheme\" content=\"dark\">"
Expand All @@ -211,9 +208,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, DarkModeTextSelection) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Input) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_input",
"<style>body {margin: 8px} input {width: 150px; "
Expand All @@ -235,9 +231,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Input) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Textarea) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_textarea",
R"HTML(
Expand All @@ -256,9 +251,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Textarea) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Button) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_button",
R"HTML(
Expand Down Expand Up @@ -289,9 +283,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Button) {
#define MAYBE_ColorInput ColorInput
#endif
IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MAYBE_ColorInput) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_color_input",
R"HTML(
Expand All @@ -309,9 +302,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MAYBE_ColorInput) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Select) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_select",
R"HTML(
Expand All @@ -333,9 +325,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Select) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MultiSelect) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_multi_select",
R"HTML(
Expand All @@ -360,9 +351,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MultiSelect) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Progress) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_progress",
R"HTML(
Expand All @@ -381,9 +371,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Progress) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Meter) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_meter",
R"HTML(
Expand All @@ -409,9 +398,8 @@ IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Meter) {
}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Range) {
if (SkipTestForOldAndroidVersions()) {
GTEST_SKIP();
}
if (SkipTestForOldAndroidVersions())
return;

RunTest("form_controls_browsertest_range",
R"HTML(
Expand Down
10 changes: 10 additions & 0 deletions content/browser/form_controls_browsertest_mac.h
@@ -0,0 +1,10 @@
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_FORM_CONTROLS_BROWSERTEST_MAC_H_
#define CONTENT_BROWSER_FORM_CONTROLS_BROWSERTEST_MAC_H_

bool MacOSVersionSupportsDarkMode();

#endif // CONTENT_BROWSER_FORM_CONTROLS_BROWSERTEST_MAC_H_
11 changes: 11 additions & 0 deletions content/browser/form_controls_browsertest_mac.mm
@@ -0,0 +1,11 @@
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/form_controls_browsertest_mac.h"

bool MacOSVersionSupportsDarkMode() {
if (@available(macOS 10.14, *))
return true;
return false;
}
2 changes: 0 additions & 2 deletions content/public/test/browser_test_utils.h
Expand Up @@ -2405,8 +2405,6 @@ RegisterWebContentsCreationCallback(
// and/or main. This can be useful to enable when the process hosting the window
// is a standalone executable without an Info.plist.
bool EnableNativeWindowActivation();

bool MacOSVersionSupportsDarkMode();
#endif // BUILDFLAG(IS_MAC)

} // namespace content
Expand Down
7 changes: 0 additions & 7 deletions content/public/test/browser_test_utils_mac.mm
Expand Up @@ -21,11 +21,4 @@ bool EnableNativeWindowActivation() {
: false;
}

bool MacOSVersionSupportsDarkMode() {
if (@available(macOS 10.14, *)) {
return true;
}
return false;
}

} // namespace content
4 changes: 3 additions & 1 deletion content/test/BUILD.gn
Expand Up @@ -1289,6 +1289,7 @@ test("content_browsertests") {
"../browser/find_request_manager_browsertest.cc",
"../browser/font_access/font_access_manager_browsertest.cc",
"../browser/font_unique_name_lookup/font_unique_name_browsertest.cc",
"../browser/form_controls_browsertest.cc",
"../browser/generic_sensor/generic_sensor_browsertest.cc",
"../browser/gpu/gpu_ipc_browsertests.cc",
"../browser/gpu/in_process_gpu_thread_browsertests.cc",
Expand Down Expand Up @@ -1519,7 +1520,6 @@ test("content_browsertests") {
"../child/webthemeengine_impl_default_browsertest.cc",
"../renderer/accessibility/render_accessibility_impl_browsertest.cc",
"../renderer/blink_platform_audio_hardware_browsertest.cc",
"../renderer/form_controls_browsertest.cc",
"../renderer/gin_browsertest.cc",
"../renderer/media/renderer_webmediaplayer_delegate_browsertest.cc",
"../renderer/media/too_many_web_media_players_intervention_browsertest.cc",
Expand Down Expand Up @@ -1940,6 +1940,8 @@ test("content_browsertests") {
"../browser/accessibility/ax_tree_formatter_mac_browsertest.mm",
"../browser/accessibility/browser_accessibility_cocoa_browsertest.mm",
"../browser/accessibility/hit_testing_mac_browsertest.mm",
"../browser/form_controls_browsertest_mac.h",
"../browser/form_controls_browsertest_mac.mm",
"../browser/keyboard_lock_browsertest_mac.mm",
"../browser/pointer_lock_browsertest_mac.mm",
"../browser/renderer_host/render_frame_host_impl_mac_browsertest.mm",
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_button_linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_button_win.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_input_linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_input_mac.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_input_win.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_meter_linux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_meter_mac.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_meter_win.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_progress_mac.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_progress_win.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/test/data/forms/form_controls_browsertest_radio_android.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified content/test/data/forms/form_controls_browsertest_range_mac.png
Binary file modified content/test/data/forms/form_controls_browsertest_select_linux.png
Binary file modified content/test/data/forms/form_controls_browsertest_select_win.png

0 comments on commit ada2293

Please sign in to comment.