Autogenerated *InterceptorForTesting classes bypass StructTraits message validation?

329 views
Skip to first unread message

Justin Lulejian

unread,
Apr 28, 2025, 12:43:07 PMApr 28
to chromium-mojo
Hi chromium-mojo!

I've implemented a StructTraits specialization for renderer message validation. As previously established, the invalid messages now cause the renderer process to automatically be terminated.

This change required removing a test that used `*InterceptorForTesting` as it bypassed the new StructTraits specialization.

Could you please clarify if `*InterceptorForTesting` classes are meant to bypass StructTraits specializations?

Also, if a test specifically needs to verify renderer process termination due to an invalid message caught by the StructTraits specialization, what is the recommended approach for writing such a test? This is assuming it would be very complicated to induce the renderer to produce bad input so intercepting and changing an existing message would be much preferred.

--
Best regards,
Justin

Justin Lulejian | SWE - Chrome Extensions, US-REMOTE-CT | jlul...@google.com

Daniel Cheng

unread,
Apr 28, 2025, 3:06:49 PMApr 28
to Justin Lulejian, chromium-mojo
No, a test interceptor should not bypass struct traits.

Daniel

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAFuoSPHSYbEWB7L%2B-aw2gmCt7vB3GArSduKwX_FTFXrAsrcNPQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages