Route document workflow prompts through app core
This commit is contained in:
@@ -87,6 +87,34 @@ void save_version_respects_menu_and_hotkey_behaviors(pp::tests::Harness& harness
|
||||
== pp::app::DocumentSaveDecision::show_save_dialog);
|
||||
}
|
||||
|
||||
void workflow_without_canvas_is_unavailable(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
pp::app::plan_document_workflow(false, false)
|
||||
== pp::app::DocumentWorkflowDecision::unavailable);
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
pp::app::plan_document_workflow(false, true)
|
||||
== pp::app::DocumentWorkflowDecision::unavailable);
|
||||
}
|
||||
|
||||
void workflow_with_clean_canvas_continues_now(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
pp::app::plan_document_workflow(true, false)
|
||||
== pp::app::DocumentWorkflowDecision::continue_now);
|
||||
}
|
||||
|
||||
void workflow_with_dirty_canvas_prompts_for_save(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
pp::app::plan_document_workflow(true, true)
|
||||
== pp::app::DocumentWorkflowDecision::prompt_save_before_continue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -100,5 +128,8 @@ int main()
|
||||
harness.run("save new or dirty document has user visible work", save_new_or_dirty_document_has_user_visible_work);
|
||||
harness.run("save as always shows save dialog", save_as_always_shows_save_dialog);
|
||||
harness.run("save version respects menu and hotkey behaviors", save_version_respects_menu_and_hotkey_behaviors);
|
||||
harness.run("workflow without canvas is unavailable", workflow_without_canvas_is_unavailable);
|
||||
harness.run("workflow with clean canvas continues now", workflow_with_clean_canvas_continues_now);
|
||||
harness.run("workflow with dirty canvas prompts for save", workflow_with_dirty_canvas_prompts_for_save);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user