chromium/components/viz/host/host_gpu_memory_buffer_manager_unittest.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 "components/viz/host/host_gpu_memory_buffer_manager.h"

#include <string>
#include <utility>
#include <vector>

#include "base/clang_profiling_buildflags.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/threading/thread.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "gpu/ipc/common/gpu_memory_buffer_support.h"
#include "gpu/ipc/common/surface_handle.h"
#include "media/media_buildflags.h"
#include "services/viz/privileged/mojom/gl/gpu_service.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/client_native_pixmap_factory.h"

#if BUILDFLAG(IS_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#endif

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

namespace viz {

namespace {

constexpr int kHostGpuMemoryBufferManagerId =;

bool MustSignalGmbConfigReadyForTest() {}

class TestGpuService : public mojom::GpuService {};

}  // namespace

class HostGpuMemoryBufferManagerTest : public ::testing::Test {};

TEST_F(HostGpuMemoryBufferManagerTest, GpuMemoryBufferDestroyed) {}

TEST_F(HostGpuMemoryBufferManagerTest,
       GpuMemoryBufferDestroyedOnDifferentThread) {}

// Tests that if an allocated buffer is received after the gpu service issuing
// it has died, HGMBManager retries the allocation request properly.
TEST_F(HostGpuMemoryBufferManagerTest, AllocationRequestFromDeadGpuService) {}

// Test that any pending CreateGpuMemoryBuffer() requests are cancelled, so
// blocked threads stop waiting, on shutdown.
TEST_F(HostGpuMemoryBufferManagerTest, CancelRequestsForShutdown) {}

}  // namespace viz