mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-06 15:15:47 +02:00
Despite the `enableSignatureVerification` option/preference being enabled in development mode and TESTING builds, the lack of any `SignatureVerifier` implementation still renders the UI disabled. This seems unfortunate, since it makes it more difficult to check that the digital signature UI works correctly: - That the button is visible when it's supposed to be, and that the panel can be opened/closed. - That the UI looks correct, w.r.t. the HTML elements and their CSS rules. - Currently the viewer JS code is effectively uncovered, with overall test-coverage dropping from `90` to `89` percent when PR 21247 landed. To improve the current situation this patch adds a `FakeSignatureVerifier` class, limited to only development mode and TESTING builds, that treats every digital signature as invalid. This allows easier manual testing, and also the addition of a few *very rudimentary* integration-tests. *Note:* It probably wouldn't be all that difficult to add additional integration-tests for *valid* certificates, by having the test-cases instruct (during setup) the `FakeSignatureVerifier` how to respond to simulate verified certificates.