From c2ab3b470f3022d12e35ab2e2e7fe24e3b08091c Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 20 Mar 2024 10:36:35 -0700 Subject: [PATCH] [Impeller] add test that demonstrates that VVL failures are fatal. (flutter/engine#51525) Fixes https://github.com/flutter/flutter/issues/145118 --- .../flutter/impeller/entity/entity_unittests.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/engine/src/flutter/impeller/entity/entity_unittests.cc b/engine/src/flutter/impeller/entity/entity_unittests.cc index 1592bcb1198..7dcebc01f81 100644 --- a/engine/src/flutter/impeller/entity/entity_unittests.cc +++ b/engine/src/flutter/impeller/entity/entity_unittests.cc @@ -2798,6 +2798,20 @@ TEST_P(EntityTest, FillPathGeometryGetPositionBufferReturnsExpectedMode) { } } +TEST_P(EntityTest, FailOnValidationError) { + if (GetParam() != PlaygroundBackend::kVulkan) { + GTEST_SKIP() << "Validation is only fatal on Vulkan backend."; + } + EXPECT_DEATH( + // The easiest way to trigger a validation error is to try to compile + // a shader with an unsupported pixel format. + GetContentContext()->GetBlendColorBurnPipeline({ + .color_attachment_pixel_format = PixelFormat::kUnknown, + .has_depth_stencil_attachments = false, + }), + ""); +} + } // namespace testing } // namespace impeller