Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53eaccb6 authored by John Reck's avatar John Reck
Browse files

Fix race condition in releasedCallback test

WebViewFunctor::~Handle() does a post() to renderthread for
destruction. So the test needs to fence after the last sync to ensure
the posted message is processed before proceeding.

Fixes: 173156648
Test: hwuiunit --gtest_repeat=10000 --gtest_filter=RenderNode.releasedCallback --gtest_break_on_failure
Change-Id: I71d21cde43db3f689788e1d0685b30f9e6fdec15
parent be41f05d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -264,6 +264,8 @@ TEST(RenderNode, releasedCallback) {
    TestUtils::runOnRenderThreadUnmanaged([&] (RenderThread&) {
        TestUtils::syncHierarchyPropertiesAndDisplayList(node);
    });
    // Fence on any remaining post'd work
    TestUtils::runOnRenderThreadUnmanaged([] (RenderThread&) {});
    EXPECT_EQ(2, counts.sync);
    EXPECT_EQ(1, counts.destroyed);
}