BLASTBufferQueueTest: Fix leak of BBQ and SC
A newly added test results in a dangling reference which causes
a SurfaceControl to not be cleaned up. This occludes the screen
and interferes with further tests. While BLASTBufferQueue is
expectin a complete callback, a manually incremented reference
is kept. The sync transaction in this test is not applied
(since it's just used to verify some release on buffer
overwrite semantics). This results in this manually incremented
reference dangling. We can fix this easily by applying the transaction
after verifying the test success.
Bug: 237010140
Test: Existing tests pass
Change-Id: I30b48111ab236acda5cce3f240149ccaa353b89b
diff --git a/libs/gui/tests/BLASTBufferQueue_test.cpp b/libs/gui/tests/BLASTBufferQueue_test.cpp
index a071eb9..3e563b2 100644
--- a/libs/gui/tests/BLASTBufferQueue_test.cpp
+++ b/libs/gui/tests/BLASTBufferQueue_test.cpp
@@ -1148,6 +1148,7 @@
ASSERT_EQ(NO_ERROR, captureDisplay(mCaptureArgs, mCaptureResults));
ASSERT_NO_FATAL_FAILURE(
checkScreenCapture(r, g, b, {0, 0, (int32_t)mDisplayWidth, (int32_t)mDisplayHeight}));
+ sync.apply();
}
// This test will currently fail because the old surfacecontrol will steal the last presented buffer