pdf.js/test/unit
Jonas Jenwald 642d8621ef Replace direct lookup of uniquePrefix/idCounters, in Page instances, with an idFactory containing an createObjId method instead
We're currently making use of `uniquePrefix`/`idCounters` in multiple files, to create unique object id's, and adding a new occurrence of them requires some care to ensure that an object id isn't accidentally reused.
Furthermore, having to pass around multiple parameters as we currently do seem like something you want to avoid.

Instead, this patch adds a factory which means that there's only *one* thing that needs to be passed around. And since it's now only necessary to call a method in order to obtain a unique object id, the details are thus abstracted away at the call-sites which avoids accidental reuse of object id's.

To test that this works as expected a very simple `Page` unit-test is added, and the existing `Annotation layer` tests are also adjusted slightly.
2017-01-09 23:16:25 +01:00
..
annotation_layer_spec.js Replace direct lookup of uniquePrefix/idCounters, in Page instances, with an idFactory containing an createObjId method instead 2017-01-09 23:16:25 +01:00
api_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
cff_parser_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
clitests.json Replace direct lookup of uniquePrefix/idCounters, in Page instances, with an idFactory containing an createObjId method instead 2017-01-09 23:16:25 +01:00
cmap_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
crypto_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
document_spec.js Replace direct lookup of uniquePrefix/idCounters, in Page instances, with an idFactory containing an createObjId method instead 2017-01-09 23:16:25 +01:00
dom_utils_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
evaluator_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
fonts_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
function_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
jasmine-boot.js Replace direct lookup of uniquePrefix/idCounters, in Page instances, with an idFactory containing an createObjId method instead 2017-01-09 23:16:25 +01:00
metadata_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
murmurhash3_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
network_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
parser_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
primitives_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
stream_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
testreporter.js Switch to using ESLint, instead of JSHint, for linting 2016-12-16 21:06:36 +01:00
type1_parser_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
ui_utils_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
unicode_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00
unit_test.html unit test files as UMD modules 2017-01-09 11:40:57 -05:00
util_spec.js unit test files as UMD modules 2017-01-09 11:40:57 -05:00