Commit Graph

145 Commits

Author SHA1 Message Date
Collin Anderson
54e984c763 cleaned whitespace 2015-02-17 11:07:37 -05:00
Tim van der Meij
b215af30d3 Require destinations when they are needed and do not fetch all of them in advance 2014-10-06 22:26:18 +02:00
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.
2014-09-23 13:16:58 +02:00
Jonas Jenwald
27a80f3b88 Add unit test for |MissingPDFException| 2014-09-08 22:34:26 +02:00
Jonas Jenwald
6077e93275 In test/unit/api_spec.js rename the function waitsForPromise to waitsForPromiseResolvedand add a waitsForPromiseRejected function 2014-09-08 22:34:26 +02:00
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.
2014-08-30 22:12:34 +02:00
Jonas Jenwald
9f1e140c4f Add unit test for PDF file loaded as typed array 2014-08-15 17:21:46 +02:00
Jonas Jenwald
b201cc4940 Remove the remaining references to cidmaps.js from the test suite 2014-08-14 12:42:57 +02:00
Jonas Jenwald
1fb404aff2 Fix CMap unit tests
When the binary CMaps were added, some of the relevant unit tests were not changed. This patch updates them, so that we actually test the current implementation.
What's somewhat troubling here is that we currently have CMap unit tests that passes, *despite* not working as intended (the CMap files doesn't load).
2014-08-14 12:36:49 +02:00
Jonas Jenwald
06b5d97bc6 Remove two instances of leftover console.log debug statements
The `console.log` statement in evaluator_spec.js is obviously not needed. In obj.js it could have been replaced by `info`, but that seemed unnecessary given the already existing `error`.
2014-08-13 14:29:46 +02:00
Jonas Jenwald
c3691500fa Merge pull request #5172 from nnethercote/readCharCode-retval
Avoid an allocation in readCharCode().
2014-08-13 11:03:07 +02:00
Nicholas Nethercote
61e6b576d4 Avoid an allocation in readCharCode().
readCharCode() returns two values, and currently allocates a length-2
array on every call to do so. This change makes it instead us a
passed-in object which can be reused.

This tiny change reduces the total JS allocations done for the document
in Mozilla bug 992125 by 4.2%.
2014-08-12 16:12:58 -07:00
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.
2014-08-12 12:09:31 +02:00
Jonas Jenwald
cb4a847347 Merge pull request #5134 from yurydelendik/fun4
Improves speed of the functions
2014-08-05 23:51:03 +02:00
Yury Delendik
6865c284a7 Merge pull request #5111 from nnethercote/better-cidchars
Represent cid chars using integers, not strings.
2014-08-04 22:26:55 -05:00
Yury Delendik
f750e35224 Optimizes functions to not create arrays 2014-08-04 11:23:11 -05:00
Yury Delendik
cb81bd6be6 Compiles some of the FunctionType 4 2014-08-04 11:21:31 -05:00
Nicholas Nethercote
adf58ed687 Represent cid chars using integers, not strings.
cid chars are 16-bit unsigned integers. Currently we convert them to
single-char strings when inserting them into the CMap, and then convert
them back to integers when extracting them from the CMap. This patch
changes CMap so that cid chars stay in integer format throughout, saving
both time and space.

When loading the PDF from issue #4580, this change reduces peak RSS from
~600 to ~370 MiB. It also improves overall speed on that PDF by ~26%,
going from 724 ms to 533 ms.
2014-08-01 02:35:17 -07:00
Tim van der Meij
b0349cd184 Use strict equalities in test/unit/{function_spec, stream_spec, testreporter}.js 2014-07-31 23:08:55 +02:00
Tim van der Meij
7586d777eb Enforcing JSHint's undef option 2014-07-19 16:41:07 +02:00
Tim van der Meij
34728ee49b Removing unused code 2014-07-18 22:34:50 +02:00
Nicholas Nethercote
081866a184 Use null instead of [] for ops with no args.
This reduces peak RSS on one test file from ~600 to ~560 MiB.
2014-06-22 16:03:48 -07:00
Yury Delendik
bdeca30fbf Splits shared/annotation.js into core/ and display/ 2014-06-17 17:43:33 -05:00
pramodhkp
1d00e9d13c Added getOperatorList to api.js 2014-06-18 01:30:42 +05:30
Daniel West
1fce2856c6 Added support for decrypting PDF 1.7/2.0 Algorithm 5 revision 5 and 6.
*Added AES128 Encryption
*Added AES258 Encryption/Decryption
*Added SHA256
*Added SHA512
*Added class to handle 8 byte integers and associated bit operations
*Added SHA384
*Added routines to handle new algorithm and perform PDF2.0 hashing.
2014-06-13 13:05:47 -05:00
Yury Delendik
fcc4dfd9b5 Moves shared/function.js to core/ 2014-05-23 14:11:47 -05:00
Yury Delendik
7a19085159 Moves shared/colorspace.js into core/ 2014-05-23 14:11:47 -05:00
Jonas Jenwald
7079992d89 Merge pull request #4770 from yurydelendik/promise-operationlist
Adds Promises to getOperatorList
2014-05-19 23:22:40 +02:00
Yury Delendik
d8eb8b1de1 Adds Promise to the getOperatorList 2014-05-19 16:19:54 -05:00
Jonas Jenwald
a984fe5b55 Add more unit tests for the API 2014-05-18 23:35:29 +02:00
Christian Krebs
3e7bcaa892 Handle nested post script arguments in the preprocessor
Fix for issue #4785
2014-05-15 19:49:43 +02:00
Yury Delendik
179f4231e6 Merge pull request #4795 from Snuffleupagus/getData-unittest
Add unit test for getData
2014-05-14 06:55:40 -05:00
Jonas Jenwald
3adab8b183 Fix unit test for getDestinations 2014-05-14 12:54:18 +02:00
Jonas Jenwald
e00b986bd3 Add unit test for getData 2014-05-14 11:57:48 +02:00
Michał Gołębiowski
e625af3fef Remove type="text/javascript" from script tags.
"text/javascript" is not a correct MIME type (the correct one is
"application/javascript") but it's not even needed; all browsers default
to the correct type and treat it as executable JS when type is ommited.
Since not all browsers recognize the "application/javascript" MIME type
the only way to both stay compliant and to support all popular browsers
is to omit the type. It's also shorter this way.
2014-05-13 02:41:01 +02:00
Yury Delendik
a26d28a393 Merge pull request #4683 from yurydelendik/grouppath
Groups path commands into single operation
2014-05-08 22:16:58 -05:00
Tim van der Meij
4caf5b694e Completes unit tests for PostScript evaluator and fixes two bugs in the evaluator itself 2014-05-03 12:18:18 +02:00
Yury Delendik
63d5aae3f6 Groups path commands into single command 2014-04-30 09:09:04 -05:00
Thorben Bochenek
e8f0700bfa Move the colour conversion to jpg.js
Benchmarking shows that this improves performance for the invitation document
from https://github.com/mozilla/pdf.js/issues/3809 by 35%
2014-04-24 15:07:12 +02:00
Yury Delendik
2c6692050b Merge pull request #4640 from yurydelendik/special-powers
Fix special powers add-on for firefox.
2014-04-17 08:06:54 -05:00
Brendan Dahl
70ce3a88a1 Use special powers quit in unit tests. 2014-04-17 07:34:34 -05:00
Tim van der Meij
7a2cb7cddd Fixes lint warning W004 in /test 2014-04-11 00:02:33 +02:00
Yury Delendik
f57c6935d7 Implements WebGL support 2014-04-03 08:36:22 -05:00
Yury Delendik
20a91bcdbf Fixes ignoring of the escaped CR LF 2014-03-20 11:50:12 -05:00
Thorben Bochenek
c547f17ee5 Add Test for PDFDocumentProxy_getPageIndex 2014-03-19 10:17:58 +01:00
Jonas Jenwald
2bd81786c2 Fix coding style in test/unit/testreporter.js 2014-03-14 15:46:23 +01:00
Jonas Jenwald
9e3f7e4d6d Fix coding style in test/unit/crypto_spec.js 2014-03-14 15:41:12 +01:00
Jonas Jenwald
6489a80dd0 Fix coding style in test/unit/font_spec.js 2014-03-14 15:38:34 +01:00
Jonas Jenwald
3cd64a85ba Fix coding style in test/unit/function_spec.js 2014-03-14 15:35:04 +01:00
Jonas Jenwald
7d4acc13fb Fix coding style in test/unit/parser_spec.js 2014-03-14 15:32:32 +01:00