pdf.js/test/unit
Jonas Jenwald 710704508c Fail early, in modern GENERIC builds, if certain required browser functionality is missing (issue 11762)
With two kind of builds now being produced, with/without translation/polyfills, it's unfortunately somewhat easy for users to accidentally pick the wrong one.

In the case where a user would attempt to use a modern build of PDF.js in an older browser, such as e.g. IE11, the failure would be immediate when the code is loaded (given the use of unsupported ECMAScript features).
However in some browsers/environments, in particular Node.js, a modern PDF.js build may load correctly and thus *appear* to function, only to fail for e.g. certain API calls. To hopefully lessen the support burden, and to try and improve things overall, this patch adds checks to ensure that a modern build of PDF.js cannot be used in browsers/environments which lack native support for critical functionality (such as e.g. `ReadableStream`). Hence we'll fail early, with an error message telling users to pick an ES5-compatible build instead.

To ensure that we actually test things better especially w.r.t. usage of the PDF.js library in Node.js environments, the `gulp npm-test` task as used by Node.js/Travis was changed (back) to test an ES5-compatible build.
(Since the bots still test the code as-is, without transpilation/polyfills, this shouldn't really be a problem as far as I can tell.)
As part of these changes there's now both `gulp lib` and `gulp lib-es5` build targets, similar to e.g. the generic builds, which thanks to some re-factoring only required adding a small amount of code.

*Please note:* While it's probably too early to tell if this will be a widespread issue, it's possible that this is the sort of patch that *may* warrant being `git cherry-pick`ed onto the current beta version (v2.4.456).
2020-04-01 19:42:48 +02:00
..
annotation_spec.js Use the ESLint no-restricted-syntax rule to prevent direct usage of new Cmd()/new Name()/new Ref() 2020-02-22 21:15:00 +01:00
api_spec.js Remove variable shadowing from the JavaScript files in the test/unit/ folder 2020-03-24 10:44:17 +01:00
bidi_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
cff_parser_spec.js Merge pull request #11744 from janpe2/cff-glyph-zero 2020-03-24 23:52:21 +01:00
clitests_helper.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01: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 Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
colorspace_spec.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
core_utils_spec.js Rename the isSpace helper function to isWhiteSpace 2020-03-12 11:36:59 +01:00
crypto_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
custom_spec.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
display_svg_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
display_utils_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
document_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
encodings_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
evaluator_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
fetch_stream_spec.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
function_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
jasmine-boot.js Update the eslint-plugin-no-unsanitized package to the latest version 2020-03-20 11:25:39 +01:00
message_handler_spec.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
metadata_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
murmurhash3_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
network_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
network_utils_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
node_stream_spec.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
parser_spec.js Remove variable shadowing from the JavaScript files in the test/unit/ folder 2020-03-24 10:44:17 +01:00
pdf_find_controller_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
pdf_find_utils_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
pdf_history_spec.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
primitives_spec.js Slightly simplify the lookup of data in Dict.{get, getAsync, has} 2020-03-06 14:12:14 +01:00
stream_spec.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
test_utils.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
testreporter.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
type1_parser_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
ui_utils_spec.js [api-minor] Remove the eventBusDispatchToDOM option/preference, and thus the general ability to dispatch "viewer components" events to the DOM 2020-03-29 12:24:46 +02:00
unicode_spec.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
unit_test.html Replaces RequireJS to SystemJS. 2017-02-27 08:32:39 -06:00
util_spec.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00