Jonas Jenwald
ae255f8921
Slightly improved `getPage` unit-tests
10 years ago
Rob Wu
c676ecb5a0
Detect scripted auto-print requests
...
Fixes #6106
To avoid future regressions, two new unit tests were added:
1. A new PDF based on the report from #6106 , which contains an
OpenAction of type JavaScript and a string "this.print({...}".
2. An existing PDF from https://bugzil.la/1001080 (from #4698 ).
Although it does not matter, since we don't execute the JavaScript code,
I have also changed "print(true)" to "print({})" since the print method
takes an object (not a boolean). See "Printing PDF documents", page 62:
http://adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_developer_guide.pdf
10 years ago
Jonas Jenwald
940bedf75f
Add a unit-test that attempts to fetch a non-existent named destination
...
Doing this helped uncover an issue with the `getDestination` implementation.
Currently if a named destination doesn't exist, the method (in `obj.js`) may return `undefined` which leads to the promise being stuck in a pending state.
*Note:* returning `null` for this case is consistent with other methods, e.g. `getOutline` and `getAttachments`.
10 years ago
Jonas Jenwald
38955d491f
Further improvements of the getStats and getDownloadInfo unit tests
...
The patch adds a test to ensure that `getStats` returns the expected result after the page has been parsed, and cleans up the existing test a bit.
Also, since I'm touching the file anyway, I'm making a small adjustment of the `getDownloadInfo` test. (I have no idea why I didn't just write it like this initially.)
10 years ago
Mike Corbin
4c9b65f0e1
Extract correct PDF format version from the catalog
...
The 'Version' field of the most recent document catalog, if present, is
intended to supersede the value in the file prologue.
This is significant for incrementally-built PDF documents and generators that
emit a low version in the prologue and later apply a format version based on
PDF features used, such as Apple's CoreGraphics/Quartz PDF backend.
Fixes the internal version variable, as well as the PDFFormatVersion reported
by the API and consumed by viewers.
10 years ago
Jonas Jenwald
36ac67583f
Remove commented out code about |disableWorker| in the test suite
...
Since the tests have run with workers enabled for a long time, these comments are no longer relevant.
10 years ago
Tim van der Meij
b215af30d3
Require destinations when they are needed and do not fetch all of them in advance
11 years ago
Jonas Jenwald
dc5b0d251f
Improve the getData unit test
...
As a follow-up to PR #4795 , this patch improves the `getData` unit test to ensure that the returned data is of the expected type and of the correct length.
11 years ago
Jonas Jenwald
27a80f3b88
Add unit test for |MissingPDFException|
11 years ago
Jonas Jenwald
6077e93275
In test/unit/api_spec.js rename the function `waitsForPromise` to `waitsForPromiseResolved`and add a `waitsForPromiseRejected` function
11 years ago
Jonas Jenwald
fb7489ffd0
Add getStats unit test
...
Since some Telemetry data depends on `getStats`, having a unit test should make it more diffucult to accidentally break this without noticing.
11 years ago
Jonas Jenwald
9f1e140c4f
Add unit test for PDF file loaded as typed array
11 years ago
Jonas Jenwald
fc5ad8a8d6
Add even more unit tests for the API
...
This patch replaces most of the remaining TODOs in test/unit/api_spec.js with actual tests.
11 years ago
Tim van der Meij
34728ee49b
Removing unused code
11 years ago
pramodhkp
1d00e9d13c
Added getOperatorList to api.js
11 years ago
Jonas Jenwald
a984fe5b55
Add more unit tests for the API
11 years ago
Jonas Jenwald
3adab8b183
Fix unit test for getDestinations
11 years ago
Jonas Jenwald
e00b986bd3
Add unit test for getData
11 years ago
Thorben Bochenek
c547f17ee5
Add Test for PDFDocumentProxy_getPageIndex
11 years ago
Yury Delendik
5bf3e44e30
Introduces LegacyPromise; polyfills DOM Promise
11 years ago
Brendan Dahl
730a2cc550
Increase api unit tests timeout for chrome.
12 years ago
Brendan Dahl
5ecce4996b
Split files into worker and main thread pieces.
12 years ago
Brendan Dahl
ae1f973204
Use A+ spec compatible promises.
12 years ago
Mack Duan
6b2c6fc223
Changes to regression tests for progressive loading
12 years ago
Yury Delendik
81f8f92696
Adds web/* and test/* for jshint target
12 years ago
Brendan Dahl
66563d0f95
Increase wait timeout for api unit tests.
13 years ago
Yury Delendik
0dd445bf18
Fixes unit tests and adds few for util.js
13 years ago
Brendan Dahl
e18a2c512e
Use test.py for unit tests too.
13 years ago
Brendan Dahl
19c0c6a983
Add back other unit tests. Disable worker.
13 years ago
Brendan Dahl
3925e37417
Add basic api unit testing.
13 years ago