Harden app runtime and thin export shell
This commit is contained in:
@@ -38,6 +38,33 @@ void task_dispatch_does_not_wait_for_stopped_worker(pp::tests::Harness& harness)
|
||||
PP_EXPECT(harness, !plan.wait_for_completion);
|
||||
}
|
||||
|
||||
void runtime_task_dispatch_rejects_stopped_worker_enqueue(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto plan = pp::app::plan_app_runtime_task_dispatch(false, true, 2, false, true, true);
|
||||
|
||||
PP_EXPECT(harness, !plan.execute_immediately);
|
||||
PP_EXPECT(harness, !plan.queue_task);
|
||||
PP_EXPECT(harness, !plan.remove_matching_unique_task);
|
||||
PP_EXPECT(harness, !plan.notify_worker);
|
||||
PP_EXPECT(harness, !plan.wait_for_completion);
|
||||
PP_EXPECT(harness, !plan.request_redraw);
|
||||
PP_EXPECT(harness, !plan.reject_unsafe_cross_thread_dispatch);
|
||||
PP_EXPECT(harness, plan.reject_stopped_worker_dispatch);
|
||||
}
|
||||
|
||||
void runtime_task_dispatch_executes_immediately_on_target_thread(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto plan = pp::app::plan_app_runtime_task_dispatch(true, true, 3, false, true, true);
|
||||
|
||||
PP_EXPECT(harness, plan.execute_immediately);
|
||||
PP_EXPECT(harness, !plan.queue_task);
|
||||
PP_EXPECT(harness, !plan.remove_matching_unique_task);
|
||||
PP_EXPECT(harness, !plan.notify_worker);
|
||||
PP_EXPECT(harness, !plan.wait_for_completion);
|
||||
PP_EXPECT(harness, plan.request_redraw);
|
||||
PP_EXPECT(harness, !plan.reject_stopped_worker_dispatch);
|
||||
}
|
||||
|
||||
void task_dispatch_rejects_unsafe_cross_thread_mutations(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto plan = pp::app::plan_app_task_dispatch(false, true, 2, true, true, false, true);
|
||||
@@ -137,6 +164,8 @@ int main()
|
||||
harness.run("task dispatch executes immediately on target thread", task_dispatch_executes_immediately_on_target_thread);
|
||||
harness.run("task dispatch queues unique work and waits for running worker", task_dispatch_queues_unique_work_and_waits_for_running_worker);
|
||||
harness.run("task dispatch does not wait for stopped worker", task_dispatch_does_not_wait_for_stopped_worker);
|
||||
harness.run("runtime task dispatch rejects stopped worker enqueue", runtime_task_dispatch_rejects_stopped_worker_enqueue);
|
||||
harness.run("runtime task dispatch executes immediately on target thread", runtime_task_dispatch_executes_immediately_on_target_thread);
|
||||
harness.run("task dispatch can reject unsafe cross-thread mutations", task_dispatch_rejects_unsafe_cross_thread_mutations);
|
||||
harness.run("render queue drain wraps non empty work in context", render_queue_drain_wraps_non_empty_work_in_context);
|
||||
harness.run("ui thread tick runs tasks and schedules redraw", ui_thread_tick_runs_tasks_and_schedules_redraw);
|
||||
|
||||
Reference in New Issue
Block a user