From d473f0d24d1b694162756a13bc44822013285f41 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 1 Jun 2023 11:46:16 -0700 Subject: [PATCH] Wait for GL command completion in the ExternalTextureGLRefreshedTooOften test (flutter/engine#42438) This test sometimes caused assertion failures when running on Windows with ANGLE. The process may be unable to safely clean up global objects if GL commands are pending when the test exits. --- .../shell/platform/embedder/tests/embedder_gl_unittests.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/src/flutter/shell/platform/embedder/tests/embedder_gl_unittests.cc b/engine/src/flutter/shell/platform/embedder/tests/embedder_gl_unittests.cc index 65d698d014..41ed0381c1 100644 --- a/engine/src/flutter/shell/platform/embedder/tests/embedder_gl_unittests.cc +++ b/engine/src/flutter/shell/platform/embedder/tests/embedder_gl_unittests.cc @@ -4019,10 +4019,14 @@ TEST_F(EmbedderTest, ExternalTextureGLRefreshedTooOften) { auto context = surface.GetGrContext(); typedef void (*glGenTexturesProc)(uint32_t n, uint32_t* textures); + typedef void (*glFinishProc)(); + glGenTexturesProc glGenTextures; + glFinishProc glFinish; glGenTextures = reinterpret_cast( surface.GetProcAddress("glGenTextures")); + glFinish = reinterpret_cast(surface.GetProcAddress("glFinish")); uint32_t name; glGenTextures(1, &name); @@ -4067,6 +4071,8 @@ TEST_F(EmbedderTest, ExternalTextureGLRefreshedTooOften) { DlImageSampling::kLinear); EXPECT_TRUE(resolve_called); + + glFinish(); } TEST_F(EmbedderTest,