Move export snapshot platform support to app core
This commit is contained in:
@@ -825,6 +825,33 @@ void export_snapshot_route_for_target_rejects_unsupported_extension(pp::tests::H
|
||||
plan.fallback_reason == "document snapshot export does not support this target");
|
||||
}
|
||||
|
||||
void export_snapshot_route_for_current_platform_uses_platform_policy(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_for_current_platform(
|
||||
pp::app::DocumentExportExecutionKind::equirectangular_file,
|
||||
report,
|
||||
"D:/Paint/demo.png");
|
||||
|
||||
#if __WEB__
|
||||
PP_EXPECT(harness, !pp::app::document_export_snapshot_platform_supported());
|
||||
PP_EXPECT(harness, !plan.uses_document_snapshot_writer);
|
||||
PP_EXPECT(harness, !plan.platform_supported);
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
plan.fallback_reason == "document snapshot export is disabled on this platform");
|
||||
#else
|
||||
PP_EXPECT(harness, pp::app::document_export_snapshot_platform_supported());
|
||||
PP_EXPECT(harness, plan.uses_document_snapshot_writer);
|
||||
PP_EXPECT(harness, plan.platform_supported);
|
||||
PP_EXPECT(harness, plan.target_supported);
|
||||
PP_EXPECT(harness, plan.fallback_reason.empty());
|
||||
#endif
|
||||
}
|
||||
|
||||
void export_snapshot_route_falls_back_for_pending_renderer_payloads(pp::tests::Harness& harness)
|
||||
{
|
||||
pp::app::DocumentCanvasSaveSnapshotReport report;
|
||||
@@ -1243,6 +1270,9 @@ int main()
|
||||
harness.run(
|
||||
"export snapshot route for target rejects unsupported extension",
|
||||
export_snapshot_route_for_target_rejects_unsupported_extension);
|
||||
harness.run(
|
||||
"export snapshot route for current platform uses platform policy",
|
||||
export_snapshot_route_for_current_platform_uses_platform_policy);
|
||||
harness.run(
|
||||
"export snapshot route falls back for pending renderer payloads",
|
||||
export_snapshot_route_falls_back_for_pending_renderer_payloads);
|
||||
|
||||
Reference in New Issue
Block a user