-
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
In display/api.js
ensure that we always reject with an Error
in JpegDecode
, and adjust a couple of other rejection sites as well
#7595
In display/api.js
ensure that we always reject with an Error
in JpegDecode
, and adjust a couple of other rejection sites as well
#7595
Conversation
/botio unittest |
From: Bot.io (Linux)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/73fd2f137b27250/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/eaad3be9db5f424/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/73fd2f137b27250/output.txt Total script time: 2.10 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/eaad3be9db5f424/output.txt Total script time: 2.12 mins
|
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/55c05b9a3c5865e/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/55c05b9a3c5865e/output.txt Total script time: 1.25 mins Published |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/ac57678d81e0e69/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/ffca5119a131d44/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/ffca5119a131d44/output.txt Total script time: 23.89 mins
Image differences available at: http://107.22.172.223:8877/ffca5119a131d44/reftest-analyzer.html#web=eq.log |
done(); | ||
var outOfRangePromise = doc.getPage(100); | ||
var nonIntegerPromise = doc.getPage(2.5); | ||
var nonNumberPromise = doc.getPage('pageNumber'); |
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.
Whoops, this should have been a number given as a string, e.g. var nonNumberPromise = doc.getPage('1');
, I've pushed a new version that fixes this.
I've pushed an updated patch addressing a test-only issue, as described in #7595 (comment); no functional changes were made! |
…JpegDecode`, and adjust a couple of other rejection sites as well In the case where the document was destroyed, we were rejecting the `Promise` in `JpegDecode` with a string instead of an `Error`. The patch also brings the wording more inline with other such rejections. Use the `isInt` utility function when validating the `pageNumber` parameter in `WorkerTransport_getPage`, to make it more obvious what's actually happening. There's also a couple more unit-tests added, to ensure that we always fail in the expected way. Finally, we can simplify the rejection handling in `WorkerTransport_getPageIndexByRef` somewhat. (Note that the only reason for using `catch` here is that since the promise is rejected on the worker side, the `reason` becomes a string instead of an `Error` which is why we "re-reject" on the display side.)
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/ac57678d81e0e69/output.txt Total script time: 39.55 mins
Image differences available at: http://107.21.233.14:8877/ac57678d81e0e69/reftest-analyzer.html#web=eq.log |
/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/66e311e9cd9adcb/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/496d44512067aaf/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/66e311e9cd9adcb/output.txt Total script time: 2.02 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/496d44512067aaf/output.txt Total script time: 2.31 mins
|
Looks good, thank you! |
In the case where the document was destroyed, we were rejecting the
Promise
inJpegDecode
with a string instead of anError
. The patch also brings the wording more inline with other such rejections.Use the
isInt
utility function when validating thepageNumber
parameter inWorkerTransport_getPage
, to make it more obvious what's actually happening. There's also a couple more unit-tests added, to ensure that we always fail in the expected way.Finally, we can simplify the rejection handling in
WorkerTransport_getPageIndexByRef
somewhat. (Note that the only reason for usingcatch
here is that since the promise is rejected on the worker side, thereason
becomes a string instead of anError
which is why we "re-reject" on the display side.)