pdf.js/test
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
..
chromium Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
features Remove usage of mozFillRule 2017-01-29 23:24:44 +01:00
font Enable the ESLint no-shadow rule 2020-03-25 11:56:05 +01:00
pdfs The first glyph in CFF CIDFonts must be named 0 instead of ".notdef" 2020-03-24 15:56:50 +02:00
resources Magnifier positioning in reftest analyzer 2020-03-10 19:09:15 +02:00
stats Enable the ESLint no-shadow rule 2020-03-25 11:56:05 +01:00
ttx Update fonttools location and version (issue 6223) 2015-07-17 12:51:09 +02:00
unit Fail early, in modern GENERIC builds, if certain required browser functionality is missing (issue 11762) 2020-04-01 19:42:48 +02:00
.eslintrc Fix badly formatted .eslintrc 2018-11-23 13:49:58 +01:00
.gitignore Ignore test snapshots directory. 2013-03-15 11:24:08 -07:00
add_test.js Enable the ESLint no-shadow rule 2020-03-25 11:56:05 +01:00
annotation_layer_builder_overrides.css Convert all three-digit HEX colors to RGBA colors 2020-01-01 14:52:37 +01:00
downloadutils.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
driver.js Whitelist closure related cases to address the remaining no-shadow linting errors 2020-03-25 11:57:12 +01:00
test_manifest.json The first glyph in CFF CIDFonts must be named 0 instead of ".notdef" 2020-03-24 15:56:50 +02:00
test_slave.html Use the SimpleLinkService when running "annotations" reference tests 2017-09-12 15:24:46 +02:00
test.js Enable the ESLint no-shadow rule 2020-03-25 11:56:05 +01:00
testutils.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
text_layer_test.css Use span instead of div in the text layer 2018-11-18 15:54:08 +01:00
webbrowser.js Remove a spurious console.log from the ChromiumBrowser function in test/webbrowser.js file 2020-03-25 11:57:12 +01:00
webserver.js Enable the ESLint no-shadow rule 2020-03-25 11:56:05 +01:00