mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove buggy test to check if tasks can be posted on all native threads recursively from the emebdder. (flutter/engine#16214)
This was never thread safe to shutdown of the concurrent message loop.
This commit is contained in:
parent
bc9735b1ac
commit
275ecda4d6
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user