Route collection export targets through platform policy
This commit is contained in:
@@ -216,6 +216,12 @@ public:
|
||||
return prepared_file_writes;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool uses_work_directory_document_export_collections() override
|
||||
{
|
||||
++document_export_collection_policy_checks;
|
||||
return work_directory_document_export_collections;
|
||||
}
|
||||
|
||||
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
||||
std::string_view type,
|
||||
std::string_view default_name,
|
||||
@@ -276,12 +282,14 @@ public:
|
||||
int pick_save_file_requests = 0;
|
||||
int pick_directory_requests = 0;
|
||||
int prepared_file_write_policy_checks = 0;
|
||||
int document_export_collection_policy_checks = 0;
|
||||
int prepare_writable_file_requests = 0;
|
||||
int save_prepared_file_requests = 0;
|
||||
bool cursor_visible = false;
|
||||
bool keyboard_visible = false;
|
||||
bool prepared_file_saved = true;
|
||||
bool prepared_file_writes = true;
|
||||
bool work_directory_document_export_collections = false;
|
||||
bool deletes_recorded_files = true;
|
||||
bool live_asset_reloading = true;
|
||||
float last_platform_delta = 0.0f;
|
||||
@@ -597,6 +605,17 @@ void platform_services_dispatch_writable_file_target(pp::tests::Harness& harness
|
||||
PP_EXPECT(harness, target.write_on_background_thread);
|
||||
}
|
||||
|
||||
void platform_services_dispatch_document_export_collection_policy(pp::tests::Harness& harness)
|
||||
{
|
||||
FakePlatformServices fake("unused");
|
||||
pp::platform::PlatformServices& services = fake;
|
||||
|
||||
PP_EXPECT(harness, !services.uses_work_directory_document_export_collections());
|
||||
fake.work_directory_document_export_collections = true;
|
||||
PP_EXPECT(harness, services.uses_work_directory_document_export_collections());
|
||||
PP_EXPECT(harness, fake.document_export_collection_policy_checks == 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -620,5 +639,8 @@ int main()
|
||||
harness.run("platform services dispatch picker callbacks", platform_services_dispatch_picker_callbacks);
|
||||
harness.run("platform services dispatch prepared file save", platform_services_dispatch_prepared_file_save);
|
||||
harness.run("platform services dispatch writable file target", platform_services_dispatch_writable_file_target);
|
||||
harness.run(
|
||||
"platform services dispatch document export collection policy",
|
||||
platform_services_dispatch_document_export_collection_policy);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user