Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dkwingsmt committed Apr 5, 2024
1 parent de2a73c commit 5f38c9e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shell/platform/embedder/tests/embedder_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3446,22 +3446,29 @@ TEST_F(EmbedderTest, EmbedderThreadHostUseCustomThreadConfig) {
flutter::EmbedderThreadHost::CreateEmbedderOrEngineManagedThreadHost(
nullptr, MockThreadConfigSetter);

fml::AutoResetWaitableEvent ui_latch;
int ui_policy;
struct sched_param ui_param;

thread_host->GetTaskRunners().GetUITaskRunner()->PostTask([&] {
pthread_t current_thread = pthread_self();
pthread_getschedparam(current_thread, &ui_policy, &ui_param);
ASSERT_EQ(ui_param.sched_priority, 10);
ui_latch.Signal();
});

fml::AutoResetWaitableEvent io_latch;
int io_policy;
struct sched_param io_param;
thread_host->GetTaskRunners().GetIOTaskRunner()->PostTask([&] {
pthread_t current_thread = pthread_self();
pthread_getschedparam(current_thread, &io_policy, &io_param);
ASSERT_EQ(io_param.sched_priority, 1);
io_latch.Signal();
});

ui_latch.Wait();
io_latch.Wait();
}
#endif

Expand Down

0 comments on commit 5f38c9e

Please sign in to comment.