chromium/chrome/browser/ui/test/test_browser_ui.cc

// Copyright 2017 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/ui/test/test_browser_ui.h"

#include "base/command_line.h"
#include "base/test/gtest_util.h"
#include "base/test/test_switches.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_switches.h"

#if defined(USE_AURA)
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/window.h"
#include "ui/events/test/event_generator.h"  // nogncheck
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#endif

// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
    (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#include "content/public/common/content_switches.h"
#include "ui/base/test/skia_gold_matching_algorithm.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/test/draw_waiter_for_test.h"
#include "ui/views/test/view_skia_gold_pixel_diff.h"
#include "ui/views/widget/widget.h"
#endif

#if BUILDFLAG(IS_WIN)
#include "ui/events/platform/platform_event_source.h"
#endif

// TODO(crbug.com/40625383) support Mac for pixel tests.
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#define SUPPORTS_PIXEL_TEST
#endif

namespace {

// Extracts the |name| argument for ShowUi() from the current test case name.
// E.g. for InvokeUi_name (or DISABLED_InvokeUi_name) returns "name".
std::string NameFromTestCase() {}

#if defined(USE_AURA)
class ScopedMouseDisabler {};
#endif

}  // namespace

TestBrowserUi::TestBrowserUi() {}

TestBrowserUi::~TestBrowserUi() = default;

ui::test::ActionResult TestBrowserUi::VerifyPixelUi(
    views::Widget* widget,
    const std::string& screenshot_prefix,
    const std::string& screenshot_name) {}

ui::test::ActionResult TestBrowserUi::VerifyPixelUi(
    views::View* view,
    const std::string& screenshot_prefix,
    const std::string& screenshot_name) {}

void TestBrowserUi::SetPixelMatchAlgorithm(
    std::unique_ptr<ui::test::SkiaGoldMatchingAlgorithm> algorithm) {}

void TestBrowserUi::ShowAndVerifyUi() {}

bool TestBrowserUi::IsInteractiveUi() const {}