chromium/ui/ozone/platform/wayland/host/wayland_cursor_factory_unittest.cc

// 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 "ui/ozone/platform/wayland/host/wayland_cursor_factory.h"

#include <wayland-cursor.h>

#include "base/containers/flat_map.h"
#include "base/memory/scoped_refptr.h"
#include "ui/base/cursor/platform_cursor.h"
#include "ui/ozone/common/bitmap_cursor.h"
#include "ui/ozone/platform/wayland/test/wayland_test.h"

Values;

namespace ui {

// Overrides WaylandCursorFactory::GetCursorFromTheme() to pretend that cursors
// are really loaded.
//
// Note: the parent class does real Wayland calls that try to load the theme.
// That may succeed or fail on the bot, but as GetCursorTheme() is overridden,
// we ignore the result.
class DryRunningWaylandCursorFactory : public WaylandCursorFactory {};

class WaylandCursorFactoryTest : public WaylandTestSimple {};

// Tests that the factory holds the cursor theme until a buffer taken from it
// released.
TEST_F(WaylandCursorFactoryTest, RetainOldThemeUntilNewBufferIsAttached) {}

// Tests that the factory keeps the caches when either cursor size or buffer
// scale are changed, and only resets them when the theme is changed.
TEST_F(WaylandCursorFactoryTest, CachesSizesUntilThemeNameIsChanged) {}

}  // namespace ui