chromium/ui/ozone/platform/wayland/gpu/wayland_surface_factory_unittest.cc

// Copyright 2016 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/gpu/wayland_surface_factory.h"

#include <drm_fourcc.h>
#include <wayland-util.h>

#include <cstdint>
#include <memory>
#include <utility>
#include <vector>

#include "base/containers/flat_map.h"
#include "base/containers/queue.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/test/mock_callback.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/linux/gbm_buffer.h"
#include "ui/gfx/linux/gbm_device.h"
#include "ui/gfx/linux/test/mock_gbm_device.h"
#include "ui/gfx/native_pixmap.h"
#include "ui/gfx/overlay_plane_data.h"
#include "ui/gfx/overlay_priority_hint.h"
#include "ui/gl/gl_utils.h"
#include "ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.h"
#include "ui/ozone/platform/wayland/gpu/wayland_buffer_manager_gpu.h"
#include "ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h"
#include "ui/ozone/platform/wayland/host/wayland_subsurface.h"
#include "ui/ozone/platform/wayland/host/wayland_window.h"
#include "ui/ozone/platform/wayland/test/mock_surface.h"
#include "ui/ozone/platform/wayland/test/scoped_wl_array.h"
#include "ui/ozone/platform/wayland/test/test_wayland_server_thread.h"
#include "ui/ozone/platform/wayland/test/test_zwp_linux_buffer_params.h"
#include "ui/ozone/platform/wayland/test/wayland_test.h"
#include "ui/ozone/public/surface_ozone_canvas.h"
#include "ui/ozone/test/mock_platform_window_delegate.h"

_;
Expectation;
SaveArg;
Values;

namespace ui {

namespace {

constexpr uint32_t kAugmentedSurfaceNotSupportedVersion =;

// Holds a NativePixmap used for scheduling overlay planes. It must become busy
// when scheduled and be associated with the swap id to track correct order of
// swaps and releases of the image.
// TODO(rjkroege): Consider putting extra state inside a test NativePixmap
// implementation instead of a wrapper class.
class OverlayImageHolder : public base::RefCounted<OverlayImageHolder> {};

// Helper that helps to identify the last swap id. Also sets gl image associated
// with that swap as free.
class CallbacksHelper {};

}  // namespace

class WaylandSurfaceFactoryTest : public WaylandTest {};

TEST_P(WaylandSurfaceFactoryTest,
       GbmSurfacelessWaylandCommitOverlaysCallbacksTest) {}

TEST_P(WaylandSurfaceFactoryTest,
       GbmSurfacelessWaylandGroupOnSubmissionCallbacksTest) {}

TEST_P(WaylandSurfaceFactoryTest, Canvas) {}

TEST_P(WaylandSurfaceFactoryTest, CanvasResize) {}

// Checks that buffer swap ack is called only after Wayland calls OnSubmission.
TEST_P(WaylandSurfaceFactoryTest, CanvasBufferSwapAck) {}

// Checks that buffer swap ack for an invalid frame is called after the previous
// valid frames receive their OnSubmission calls.
TEST_P(WaylandSurfaceFactoryTest, CanvasBufferSwapAck2) {}

// Check OnSubmission is called on resize.
TEST_P(WaylandSurfaceFactoryTest, CanvasBufferSwapAck3) {}

TEST_P(WaylandSurfaceFactoryTest, CreateSurfaceCheckGbm) {}

class WaylandSurfaceFactoryCompositorV3 : public WaylandSurfaceFactoryTest {};

TEST_P(WaylandSurfaceFactoryCompositorV3, SurfaceDamageTest) {}

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

}  // namespace ui