未验证 提交 5c79a2d3 编写于 作者: C Chinmay Garde 提交者: GitHub

Remove buggy test to check if tasks can be posted on all native threads...

Remove buggy test to check if tasks can be posted on all native threads recursively from the emebdder. (#16214)

This was never thread safe to shutdown of the concurrent message loop.
上级 b98eadca
......@@ -4006,40 +4006,5 @@ TEST_F(EmbedderTest, CanPostTaskToAllNativeThreads) {
ASSERT_FALSE(engine.is_valid());
}
TEST_F(EmbedderTest, CanPostTaskToAllNativeThreadsRecursively) {
EmbedderConfigBuilder builder(GetEmbedderContext());
builder.SetSoftwareRendererConfig();
static std::mutex engine_mutex;
static UniqueEngine engine;
static fml::AutoResetWaitableEvent event;
std::unique_lock engine_lock(engine_mutex);
engine.reset();
engine = builder.LaunchEngine();
ASSERT_TRUE(engine.is_valid());
ASSERT_EQ(FlutterEnginePostCallbackOnAllNativeThreads(
engine.get(),
[](FlutterNativeThreadType type, void* baton) {
// This should deadlock if the task mutex acquisition is
// busted.
std::scoped_lock engine_lock_inner(engine_mutex);
if (engine.is_valid()) {
ASSERT_EQ(FlutterEnginePostCallbackOnAllNativeThreads(
engine.get(),
[](FlutterNativeThreadType type,
void* baton) { event.Signal(); },
nullptr),
kSuccess);
}
},
&engine),
kSuccess);
engine_lock.unlock();
event.Wait();
engine.reset();
}
} // namespace testing
} // namespace flutter
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册