Skip to content

Add a couple of basic unit-tests for PDFPageViewBuffer #14238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

The PDFPageViewBuffer-code is very important for the correct function of the viewer, but it's currently not tested at all.
While the PDFPageViewBuffer is obviously intended to be used with PDFPageView-instances, it only accesses a couple of PDFPageView properties/methods and consequently it's fairly easy to unit-test this code with dummy-data.

These unit-tests should help improve our confidence in this code, and will also come in handy with other changes that I'm working on (regarding modernizing and re-factoring the PDFPageViewBuffer-code).

@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

pdfjsbot commented Nov 5, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/62939e072d66b06/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 5, 2021

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/2cfcd293e4f043f/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 5, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/62939e072d66b06/output.txt

Total script time: 2.93 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Nov 5, 2021

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/2cfcd293e4f043f/output.txt

Total script time: 6.06 mins

  • Unit Tests: Passed

The `PDFPageViewBuffer`-code is very important for the correct function of the viewer, but it's currently not tested at all.
While the `PDFPageViewBuffer` is obviously intended to be used with `PDFPageView`-instances, it only accesses a couple of `PDFPageView` properties/methods and consequently it's fairly easy to unit-test this code with dummy-data.

These unit-tests should help improve our confidence in this code, and will also come in handy with other changes that I'm working on (regarding modernizing and re-factoring the `PDFPageViewBuffer`-code).
@Snuffleupagus Snuffleupagus force-pushed the PDFPageViewBuffer-tests branch from 12fd504 to fe205ef Compare November 5, 2021 18:43
@timvandermeij timvandermeij merged commit 30bd5f0 into mozilla:master Nov 5, 2021
@timvandermeij
Copy link
Contributor

It's great to have more unit test for the viewer logic; thank you for doing this!

@Snuffleupagus Snuffleupagus deleted the PDFPageViewBuffer-tests branch November 5, 2021 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants