Route UI state save through platform services

This commit is contained in:
2026-06-04 16:48:57 +02:00
parent 7d992931d9
commit dc369c89b0
11 changed files with 47 additions and 12 deletions

View File

@@ -144,6 +144,11 @@ public:
return browse_roots;
}
void save_ui_state() override
{
++ui_state_saves;
}
[[nodiscard]] bool enables_live_asset_reloading() override
{
++live_asset_reload_policy_checks;
@@ -239,6 +244,7 @@ public:
int exported_image_publishes = 0;
int persistent_storage_flushes = 0;
int document_browse_root_requests = 0;
int ui_state_saves = 0;
int live_asset_reload_policy_checks = 0;
int platform_frame_updates = 0;
int frame_reports = 0;
@@ -436,6 +442,16 @@ void platform_services_dispatch_document_browse_roots(pp::tests::Harness& harnes
PP_EXPECT(harness, roots[1] == "D:/Paint/Inbox");
}
void platform_services_dispatch_ui_state_save(pp::tests::Harness& harness)
{
FakePlatformServices fake("unused");
pp::platform::PlatformServices& services = fake;
services.save_ui_state();
PP_EXPECT(harness, fake.ui_state_saves == 1);
}
void platform_services_dispatch_live_asset_reload_policy(pp::tests::Harness& harness)
{
FakePlatformServices fake("unused");
@@ -542,6 +558,7 @@ int main()
harness.run("platform services dispatch recording cleanup", platform_services_dispatch_recording_cleanup);
harness.run("platform services dispatch exported image and storage flush", platform_services_dispatch_exported_image_and_storage_flush);
harness.run("platform services dispatch document browse roots", platform_services_dispatch_document_browse_roots);
harness.run("platform services dispatch UI state save", platform_services_dispatch_ui_state_save);
harness.run("platform services dispatch live asset reload policy", platform_services_dispatch_live_asset_reload_policy);
harness.run("platform services dispatch frame hooks", platform_services_dispatch_frame_hooks);
harness.run("platform services dispatch file actions", platform_services_dispatch_file_actions);