pdf.js/test/unit
Jonas Jenwald 4cc6797f17 Re-factor the idFactory functionality, used in the core/-code, and move the fontID generation into it
Note how the `getFontID`-method in `src/core/fonts.js` is *completely* global, rather than properly tied to the current document. This means that if you repeatedly open and parse/render, and then close, even the *same* PDF document the `fontID`s will still be incremented continuously.

For comparison the `createObjId` method, on `idFactory`, will always create a *consistent* id, assuming of course that the document and its pages are parsed/rendered in the same order.

In order to address this inconsistency, it thus seems reasonable to add a new `createFontId` method on the `idFactory` and use that when obtaining `fontID`s. (When the current `getFontID` method was added the `idFactory` didn't actually exist yet, which explains why the code looks the way it does.)
*Please note:* Since the document id is (still) part of the `loadedName`, it's thus not possible for different documents to have identical font names.
2020-07-07 16:33:31 +02:00
..
annotation_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
api_spec.js [api-minor] Use the NodeCanvasFactory/NodeCMapReaderFactory classes as defaults in Node.js environments (issue 11900) 2020-07-02 04:44:23 +02:00
bidi_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
cff_parser_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
clitests_helper.js Use the ESLint no-restricted-syntax rule to ensure that assert is always called with two arguments 2020-05-05 13:40:05 +02:00
clitests.json Fail early, in modern GENERIC builds, if certain required browser functionality is missing (issue 11762) 2020-04-01 19:42:48 +02:00
cmap_spec.js [api-minor] Use the NodeCanvasFactory/NodeCMapReaderFactory classes as defaults in Node.js environments (issue 11900) 2020-07-02 04:44:23 +02:00
colorspace_spec.js Improve (local) caching of parsed ColorSpaces (PR 12001 follow-up) 2020-06-24 23:53:10 +02:00
core_utils_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
crypto_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
custom_spec.js [api-minor] Use the NodeCanvasFactory/NodeCMapReaderFactory classes as defaults in Node.js environments (issue 11900) 2020-07-02 04:44:23 +02:00
display_svg_spec.js [api-minor] Decode all JPEG images with the built-in PDF.js decoder in src/core/jpg.js 2020-05-22 00:22:48 +02:00
display_utils_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
document_spec.js Re-factor the idFactory functionality, used in the core/-code, and move the fontID generation into it 2020-07-07 16:33:31 +02:00
encodings_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
evaluator_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
fetch_stream_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
function_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
jasmine-boot.js Use the ESLint no-restricted-syntax rule to ensure that assert is always called with two arguments 2020-05-05 13:40:05 +02:00
message_handler_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
metadata_spec.js Move the isEmptyObj helper function from src/shared/util.js to test/unit/test_utils.js 2020-06-09 17:50:16 +02:00
murmurhash3_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
network_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
network_utils_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
node_stream_spec.js Use the ESLint no-restricted-syntax rule to ensure that assert is always called with two arguments 2020-05-05 13:40:05 +02:00
parser_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
pdf_find_controller_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
pdf_find_utils_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
pdf_history_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
primitives_spec.js Improve unit test coverage for primitives 2020-06-07 17:31:40 +02:00
stream_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
test_utils.js Re-factor the idFactory functionality, used in the core/-code, and move the fontID generation into it 2020-07-07 16:33:31 +02:00
testreporter.js Identify browsers using the name instead of the path 2020-04-26 14:42:17 +02:00
type1_parser_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
ui_utils_spec.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
unicode_spec.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
unit_test.html Replaces RequireJS to SystemJS. 2017-02-27 08:32:39 -06:00
util_spec.js Replace non-inclusive "whitelist" term with "allowlist" 2020-06-29 17:15:14 +02:00