-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Add unit-tests for the onPassword/onProgress
callbacks of the API
#6540
Add unit-tests for the onPassword/onProgress
callbacks of the API
#6540
Conversation
var promise = PDFJS.getDocument(basicApiUrl); | ||
waitsForPromiseResolved(promise, function(data) { | ||
expect(data instanceof PDFDocumentProxy).toEqual(true); | ||
var getDocumentPromise = PDFJS.getDocument(basicApiUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(no action requred by worth mentioning: getDocument returns loadingTask, which contains the promise; we probably need to review the code base to refactor variable names)
Looks good. See if it's easy to address getDocumentPromise naming thing now. |
The standard viewer implicitly depends on the `onPassword` and `onProgress` callbacks, in order to open password protected PDF files, respectively to report file loading progress. We currently have no unit-tests for this functionality, which seems unfortunate; hence this patch. *Please note:* Rather than adding more unit-tests to `api_spec.js`, I slightly extended/reworked two existing tests. Specifically for the password test, this *does not* really change what we actually test, just how the test is done.
I've changed this patch to use /botio unittest |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/de8ab3fb32c19d8/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/76575b7081eab24/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/76575b7081eab24/output.txt Total script time: 0.75 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/de8ab3fb32c19d8/output.txt Total script time: 0.94 mins
|
…Progress-unittests Add unit-tests for the `onPassword/onProgress` callbacks of the API
Thank you for the patch. |
The standard viewer implicitly depends on the
onPassword
andonProgress
callbacks, in order to open password protected PDF files, respectively to report file loading progress. We currently have no unit-tests for this functionality, which seems unfortunate; hence this patch.Please note: Rather than adding more unit-tests to
api_spec.js
, I slightly extended/reworked two existing tests. Specifically for the password test, this does not really change what we actually test, just how the test is done.