chromium/gpu/command_buffer/client/mapped_memory_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "gpu/command_buffer/client/mapped_memory.h"

#include <stddef.h>
#include <stdint.h>

#include <list>
#include <memory>

#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
#include "gpu/command_buffer/client/command_buffer_direct_locked.h"
#include "gpu/command_buffer/service/mocks.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace gpu {

Return;
Mock;
Truly;
Sequence;
DoAll;
Invoke;
_;

class MappedMemoryTestBase : public testing::Test {};

const unsigned int MappedMemoryTestBase::kBufferSize;

// Test fixture for MemoryChunk test - Creates a MemoryChunk, using a
// CommandBufferHelper with a mock AsyncAPIInterface for its interface (calling
// it directly, not through the RPC mechanism), making sure Noops are ignored
// and SetToken are properly forwarded to the engine.
class MemoryChunkTest : public MappedMemoryTestBase {};

const int32_t MemoryChunkTest::kShmId;

TEST_F(MemoryChunkTest, Basic) {}

class MappedMemoryManagerTest : public MappedMemoryTestBase {};

TEST_F(MappedMemoryManagerTest, Basic) {}

TEST_F(MappedMemoryManagerTest, FreePendingToken) {}

TEST_F(MappedMemoryManagerTest, FreeUnused) {}

TEST_F(MappedMemoryManagerTest, ChunkSizeMultiple) {}

TEST_F(MappedMemoryManagerTest, UnusedMemoryLimit) {}

TEST_F(MappedMemoryManagerTest, MemoryLimitWithReuse) {}

TEST_F(MappedMemoryManagerTest, MaxAllocationTest) {}

}  // namespace gpu