#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/graphics/gpu/webgpu_swap_buffer_provider.h"
#include <dawn/dawn_proc.h>
#include <dawn/wire/WireClient.h>
#include <dawn/wire/WireServer.h>
#include "base/memory/raw_ptr.h"
#include "base/test/task_environment.h"
#include "gpu/command_buffer/client/webgpu_interface_stub.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/public/platform/web_graphics_context_3d_provider.h"
#include "third_party/blink/renderer/platform/graphics/gpu/drawing_buffer_test_helpers.h"
#include "third_party/blink/renderer/platform/graphics/gpu/webgpu_cpp.h"
#include "third_party/blink/renderer/platform/graphics/gpu/webgpu_native_test_support.h"
_;
Invoke;
Return;
namespace blink {
namespace {
class MockWebGPUInterface : public gpu::webgpu::WebGPUInterfaceStub { … };
class FakeProviderClient : public WebGPUSwapBufferProvider::Client { … };
class WebGPUSwapBufferProviderForTests : public WebGPUSwapBufferProvider { … };
class WireSerializer : public dawn::wire::CommandSerializer { … };
}
class WebGPUSwapBufferProviderTest : public testing::Test { … };
TEST_F(WebGPUSwapBufferProviderTest,
VerifyDestructionCompleteAfterAllResourceReleased) { … }
TEST_F(WebGPUSwapBufferProviderTest, VerifyResizingProperlyAffectsResources) { … }
TEST_F(WebGPUSwapBufferProviderTest, VerifyInsertAndWaitSyncTokenCorrectly) { … }
TEST_F(WebGPUSwapBufferProviderTest, ReuseSwapBuffers) { … }
TEST_F(WebGPUSwapBufferProviderTest, ReuseSwapBufferResize) { … }
TEST_F(WebGPUSwapBufferProviderTest,
PrepareTransferableResourceTwiceAfterDestroy) { … }
TEST_F(WebGPUSwapBufferProviderTest, VerifyMailboxDissociationOnNeuter) { … }
TEST_F(WebGPUSwapBufferProviderTest, VerifyNoDoubleMailboxDissociation) { … }
TEST_F(WebGPUSwapBufferProviderTest, ReserveTextureDescriptorForReflection) { … }
TEST_F(WebGPUSwapBufferProviderTest, VerifyZeroSizeRejects) { … }
TEST_F(WebGPUSwapBufferProviderTest,
GetLastWebGPUMailboxTextureReturnsEmptyWithoutSwapBuffer) { … }
TEST_F(WebGPUSwapBufferProviderTest,
GetLastWebGPUMailboxTextureReturnsValidTextureWithSwapBuffer) { … }
TEST_F(WebGPUSwapBufferProviderTest,
GetNewTexturePassesClientSpecifiedInternalUsagePlusRenderAttachment) { … }
TEST_F(WebGPUSwapBufferProviderTest,
GetLastMailboxTexturePassesClientSpecifiedInternalUsage) { … }
}