-
Notifications
You must be signed in to change notification settings - Fork 6k
Factor out a task synchronization help function for unit tests #28467
Conversation
| "post_task_sync.cc", | ||
| "post_task_sync.h", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this is a good place to add post_task_sync.h and post_task_sync.cc. In addition, I am not sure whether post_task_sync.h and post_task_sync.cc are good file names.
But I think we should put these helper functions in a public place like this so that other unit tests can use them directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, this sounds good to me.
53fb2ba to
6f712c9
Compare
testing/post_task_sync.h
Outdated
| void PostPlatformTaskSync(const TaskRunners& task_runners, | ||
| const std::function<void()>& function); | ||
|
|
||
| void PostUITaskSync(const TaskRunners& task_runners, | ||
| const std::function<void()>& function); | ||
|
|
||
| void PostRasterTaskSync(const TaskRunners& task_runners, | ||
| const std::function<void()>& function); | ||
|
|
||
| void PostIOTaskSync(const TaskRunners& task_runners, | ||
| const std::function<void()>& function); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove these functions and just rely on PostTaskSync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
gaaclarke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice
The pattern of synchronously executing a task happens multiple times in tests. Pulled out helper functions can make tests are easier to parse/maintain
fixes: flutter/flutter#89493
detail: #28159 (comment)
Pre-launch Checklist
writing and running engine tests.
///).