Plan document export snapshot routing
This commit is contained in:
@@ -754,6 +754,73 @@ void export_execution_log_messages_cover_legacy_paths(pp::tests::Harness& harnes
|
||||
== "Document timelapse export failed");
|
||||
}
|
||||
|
||||
void export_snapshot_route_uses_document_writer_when_ready(pp::tests::Harness& harness)
|
||||
{
|
||||
pp::app::DocumentCanvasSaveSnapshotReport report;
|
||||
report.payload_complete = true;
|
||||
report.can_export_ppi = true;
|
||||
|
||||
const auto plan = pp::app::plan_document_export_snapshot_route(
|
||||
pp::app::DocumentExportExecutionKind::equirectangular_file,
|
||||
report,
|
||||
true,
|
||||
true);
|
||||
|
||||
PP_EXPECT(harness, plan.kind == pp::app::DocumentExportExecutionKind::equirectangular_file);
|
||||
PP_EXPECT(harness, plan.action == pp::app::DocumentExportSnapshotRouteAction::use_document_snapshot_writer);
|
||||
PP_EXPECT(harness, plan.uses_document_snapshot_writer);
|
||||
PP_EXPECT(harness, plan.payload_complete);
|
||||
PP_EXPECT(harness, plan.target_supported);
|
||||
PP_EXPECT(harness, plan.platform_supported);
|
||||
PP_EXPECT(harness, plan.fallback_reason.empty());
|
||||
}
|
||||
|
||||
void export_snapshot_route_falls_back_for_pending_renderer_payloads(pp::tests::Harness& harness)
|
||||
{
|
||||
pp::app::DocumentCanvasSaveSnapshotReport report;
|
||||
report.payload_complete = false;
|
||||
|
||||
const auto plan = pp::app::plan_document_export_snapshot_route(
|
||||
pp::app::DocumentExportExecutionKind::layers_collection,
|
||||
report,
|
||||
true,
|
||||
true);
|
||||
|
||||
PP_EXPECT(harness, plan.action == pp::app::DocumentExportSnapshotRouteAction::use_legacy_export);
|
||||
PP_EXPECT(harness, !plan.uses_document_snapshot_writer);
|
||||
PP_EXPECT(harness, !plan.payload_complete);
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
plan.fallback_reason == "document snapshot still requires renderer payload readback");
|
||||
}
|
||||
|
||||
void export_snapshot_route_falls_back_for_unsupported_target_or_platform(pp::tests::Harness& harness)
|
||||
{
|
||||
pp::app::DocumentCanvasSaveSnapshotReport report;
|
||||
report.payload_complete = true;
|
||||
report.can_export_ppi = true;
|
||||
|
||||
const auto unsupported_target = pp::app::plan_document_export_snapshot_route(
|
||||
pp::app::DocumentExportExecutionKind::animation_mp4,
|
||||
report,
|
||||
false,
|
||||
true);
|
||||
const auto unsupported_platform = pp::app::plan_document_export_snapshot_route(
|
||||
pp::app::DocumentExportExecutionKind::animation_frames_collection,
|
||||
report,
|
||||
true,
|
||||
false);
|
||||
|
||||
PP_EXPECT(harness, !unsupported_target.uses_document_snapshot_writer);
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
unsupported_target.fallback_reason == "document snapshot export does not support this target");
|
||||
PP_EXPECT(harness, !unsupported_platform.uses_document_snapshot_writer);
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
unsupported_platform.fallback_reason == "document snapshot export is disabled on this platform");
|
||||
}
|
||||
|
||||
void export_start_allows_valid_canvas_state(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
@@ -1119,6 +1186,13 @@ int main()
|
||||
harness.run("export failure dialog plans titles and messages", export_failure_dialog_plans_titles_and_messages);
|
||||
harness.run("export license disabled dialog preserves legacy warning", export_license_disabled_dialog_preserves_legacy_warning);
|
||||
harness.run("export execution log messages cover legacy paths", export_execution_log_messages_cover_legacy_paths);
|
||||
harness.run("export snapshot route uses document writer when ready", export_snapshot_route_uses_document_writer_when_ready);
|
||||
harness.run(
|
||||
"export snapshot route falls back for pending renderer payloads",
|
||||
export_snapshot_route_falls_back_for_pending_renderer_payloads);
|
||||
harness.run(
|
||||
"export snapshot route falls back for unsupported target or platform",
|
||||
export_snapshot_route_falls_back_for_unsupported_target_or_platform);
|
||||
harness.run("export start allows valid canvas state", export_start_allows_valid_canvas_state);
|
||||
harness.run("export start blocks demo only when license required", export_start_blocks_demo_only_when_license_required);
|
||||
harness.run("export start reports missing canvas after license gate", export_start_reports_missing_canvas_after_license_gate);
|
||||
|
||||
Reference in New Issue
Block a user