Skip to content

Fix the unit-tests for on-demand password handling of encrypted attachments (issue 21425) - #21429

Merged
Snuffleupagus merged 2 commits into
mozilla:masterfrom
Snuffleupagus:getAttachmentContent-fix-unit-test
Jun 11, 2026
Merged

Snuffleupagus merged 2 commits into
mozilla:masterfrom
Snuffleupagus:getAttachmentContent-fix-unit-test

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

These unit-tests used a PDF that prompted for password on document load, which meant that the on-demand password handling wasn't actually being tested as intended.

Updating the unit-tests also caused the "re-prompts for encrypted attachments after incorrect passwords" test to fail, since the INCORRECT_PASSWORD password reason was being accidentally "swallowed" in the worker-thread.

…hments (issue 21425)

These unit-tests used a PDF that prompted for password on document load, which meant that the on-demand password handling wasn't actually being tested as intended.

Updating the unit-tests also caused the "re-prompts for encrypted attachments after incorrect passwords" test to fail, since the `INCORRECT_PASSWORD` password reason was being accidentally "swallowed" in the worker-thread.
@codecov-commenter

codecov-commenter commented Jun 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
βœ… Project coverage is 89.76%. Comparing base (ac64bcf) to head (587abf0).

Files with missing lines Patch % Lines
src/core/worker.js 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21429      +/-   ##
==========================================
+ Coverage   89.74%   89.76%   +0.01%     
==========================================
  Files         260      260              
  Lines       66007    66004       -3     
==========================================
+ Hits        59241    59249       +8     
+ Misses       6766     6755      -11     
Flag Coverage Ξ”
browsertest 66.84% <0.00%> (-0.02%) ⬇️
fonttest 9.02% <ΓΈ> (ΓΈ)
integrationtest 66.81% <84.21%> (+0.01%) ⬆️
unittest 57.18% <89.47%> (+0.02%) ⬆️
unittestcli 56.11% <89.47%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Snuffleupagus
Snuffleupagus marked this pull request as ready for review June 10, 2026 22:44
@Snuffleupagus
Snuffleupagus requested a review from calixteman June 10, 2026 22:44
@Snuffleupagus Snuffleupagus added the release-blocker Blocker for the upcoming release label Jun 11, 2026
….js` file

Currently the same code, for requesting the password from the main-thread, is now duplicated three times.
Let's avoid that by moving the new `getPassword` helper function, added in the previous commit, and re-use that everywhere instead.
@Snuffleupagus

Copy link
Copy Markdown
Collaborator Author

/botio browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/66c2a845bf81128/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/08cef37419a2f37/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/08cef37419a2f37/output.txt

Total script time: 18.29 mins

  • Regression tests: Passed

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/66c2a845bf81128/output.txt

Total script time: 46.10 mins

  • Regression tests: Passed

@calixteman calixteman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@Snuffleupagus
Snuffleupagus merged commit 2466a76 into mozilla:master Jun 11, 2026
29 of 31 checks passed
@Snuffleupagus
Snuffleupagus deleted the getAttachmentContent-fix-unit-test branch June 11, 2026 13:13

This branch was previously deployed

1 inactive deployment
code-coverage β€” 587abf0e Deployed Jun 11, 2026 by Snuffleupagus via windows-latest / firefox #698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core release-blocker Blocker for the upcoming release test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The unit-tests for the on-demand password handling with encrypted attachments doesn't seem to use the "correct" PDF document

4 participants