Centralize legacy network TLS policy

This commit is contained in:
2026-06-04 17:53:49 +02:00
parent c698de1482
commit 148aceb705
12 changed files with 73 additions and 26 deletions

View File

@@ -1,6 +1,8 @@
#include "platform_api/platform_services.h"
#include "test_harness.h"
#include "platform_api/network_tls_policy.h"
#include "platform_api/platform_services.h"
#include <string>
#include <string_view>
#include <utility>
@@ -649,6 +651,15 @@ void platform_services_dispatch_network_tls_policy(pp::tests::Harness& harness)
PP_EXPECT(harness, fake.network_tls_policy_checks == 2);
}
void default_network_tls_policy_matches_build_target(pp::tests::Harness& harness)
{
#if defined(__ANDROID__)
PP_EXPECT(harness, pp::platform::default_disables_network_tls_verification());
#else
PP_EXPECT(harness, !pp::platform::default_disables_network_tls_verification());
#endif
}
void platform_services_dispatch_sonarpen_policy_and_start(pp::tests::Harness& harness)
{
FakePlatformServices fake("unused");
@@ -690,6 +701,7 @@ 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("default network tls policy matches build target", default_network_tls_policy_matches_build_target);
harness.run("platform services dispatch sonarpen policy and start", platform_services_dispatch_sonarpen_policy_and_start);
return harness.finish();
}