chromium/content/browser/form_controls_browsertest.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/files/file_util.h"
#include "base/path_service.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/test/pixel_comparator.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/test_utils.h"
#include "content/shell/browser/shell.h"
#include "gpu/config/gpu_finch_features.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_switches.h"

#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#endif

// TODO(crbug.com/40625383): Move the baselines to skia gold for easier
//   rebaselining when all platforms are supported.

// To rebaseline this test on all platforms:
// 1. Run a CQ+1 dry run.
// 2. Click the failing bots for android, windows, mac, and linux.
// 3. Find the failing content_browsertests step.
// 4. Click the "Deterministic failure" link for the failing test case.
// 5. Copy the "Actual pixels" data url and paste into browser.
// 6. Save the image into your chromium checkout in content/test/data/forms/.

namespace content {

class FormControlsBrowserTest : public ContentBrowserTest {};

// Checkbox renders differently on Android x86. crbug.com/1238283
#if BUILDFLAG(IS_ANDROID) && defined(ARCH_CPU_X86)
#define MAYBE_Checkbox
#else
#define MAYBE_Checkbox
#endif

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MAYBE_Checkbox) {}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Radio) {}

#if BUILDFLAG(IS_MAC)
#define MAYBE_DarkModeTextSelection
#else
#define MAYBE_DarkModeTextSelection
#endif
IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MAYBE_DarkModeTextSelection) {}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Input) {}

#if (BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS))
#define MAYBE_Textarea
#else
#define MAYBE_Textarea
#endif
IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MAYBE_Textarea) {}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Button) {}

// TODO(crbug.com/1160104/#25) This test creates large average_error_rate on
// Android FYI SkiaRenderer Vulkan. Disable it until a resolution for is
// found.
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_ColorInput
#else
#define MAYBE_ColorInput
#endif
IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MAYBE_ColorInput) {}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Select) {}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, MultiSelect) {}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Progress) {}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Meter) {}

IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Range) {}

// TODO(jarhar): Add tests for other elements from
//   https://concrete-hardboard.glitch.me

}  // namespace content