Route SonarPen tools action through platform services
This commit is contained in:
@@ -228,6 +228,17 @@ public:
|
||||
return network_tls_verification_disabled;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool supports_sonarpen() override
|
||||
{
|
||||
++sonarpen_support_checks;
|
||||
return sonarpen_supported;
|
||||
}
|
||||
|
||||
void start_sonarpen() override
|
||||
{
|
||||
++sonarpen_starts;
|
||||
}
|
||||
|
||||
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
||||
std::string_view type,
|
||||
std::string_view default_name,
|
||||
@@ -290,6 +301,8 @@ public:
|
||||
int prepared_file_write_policy_checks = 0;
|
||||
int document_export_collection_policy_checks = 0;
|
||||
int network_tls_policy_checks = 0;
|
||||
int sonarpen_support_checks = 0;
|
||||
int sonarpen_starts = 0;
|
||||
int prepare_writable_file_requests = 0;
|
||||
int save_prepared_file_requests = 0;
|
||||
bool cursor_visible = false;
|
||||
@@ -298,6 +311,7 @@ public:
|
||||
bool prepared_file_writes = true;
|
||||
bool work_directory_document_export_collections = false;
|
||||
bool network_tls_verification_disabled = false;
|
||||
bool sonarpen_supported = false;
|
||||
bool deletes_recorded_files = true;
|
||||
bool live_asset_reloading = true;
|
||||
float last_platform_delta = 0.0f;
|
||||
@@ -635,6 +649,20 @@ void platform_services_dispatch_network_tls_policy(pp::tests::Harness& harness)
|
||||
PP_EXPECT(harness, fake.network_tls_policy_checks == 2);
|
||||
}
|
||||
|
||||
void platform_services_dispatch_sonarpen_policy_and_start(pp::tests::Harness& harness)
|
||||
{
|
||||
FakePlatformServices fake("unused");
|
||||
pp::platform::PlatformServices& services = fake;
|
||||
|
||||
PP_EXPECT(harness, !services.supports_sonarpen());
|
||||
fake.sonarpen_supported = true;
|
||||
PP_EXPECT(harness, services.supports_sonarpen());
|
||||
services.start_sonarpen();
|
||||
|
||||
PP_EXPECT(harness, fake.sonarpen_support_checks == 2);
|
||||
PP_EXPECT(harness, fake.sonarpen_starts == 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -662,5 +690,6 @@ int main()
|
||||
"platform services dispatch document export collection policy",
|
||||
platform_services_dispatch_document_export_collection_policy);
|
||||
harness.run("platform services dispatch network tls policy", platform_services_dispatch_network_tls_policy);
|
||||
harness.run("platform services dispatch sonarpen policy and start", platform_services_dispatch_sonarpen_policy_and_start);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user