diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp index af6e716a93..ec1f7c652d 100644 --- a/src/tests/DawnTest.cpp +++ b/src/tests/DawnTest.cpp @@ -344,6 +344,7 @@ void DawnTest::SetUp() { dawn::SwapChainDescriptor swapChainDesc; swapChainDesc.implementation = mBinding->GetSwapChainImplementation(); swapchain = device.CreateSwapChain(&swapChainDesc); + FlushWire(); swapchain.Configure( static_cast(mBinding->GetPreferredSwapChainTextureFormat()), dawn::TextureUsageBit::OutputAttachment, 400, 400); @@ -353,6 +354,7 @@ void DawnTest::SetUp() { } void DawnTest::TearDown() { + swapchain = dawn::SwapChain(); FlushWire(); MapSlotsSynchronously(); diff --git a/src/tests/DawnTest.h b/src/tests/DawnTest.h index a098a145ba..c3c9d4544f 100644 --- a/src/tests/DawnTest.h +++ b/src/tests/DawnTest.h @@ -47,6 +47,7 @@ #define ASSERT_DEVICE_ERROR(statement) \ StartExpectDeviceError(); \ statement; \ + FlushWire(); \ ASSERT_TRUE(EndExpectDeviceError()); struct RGBA8 { @@ -173,6 +174,7 @@ class DawnTest : public ::testing::TestWithParam { detail::Expectation* expectation); void WaitABit(); + void FlushWire(); void SwapBuffersForCapture(); @@ -182,7 +184,6 @@ class DawnTest : public ::testing::TestWithParam { std::unique_ptr mWireClient; std::unique_ptr mC2sBuf; std::unique_ptr mS2cBuf; - void FlushWire(); // Tracking for validation errors static void OnDeviceError(const char* message, DawnCallbackUserdata userdata);