mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Modernize the font-tests
This patch first of all enables linting of the files in the `test/font/` folder, and secondly it also re-factors all test files to use native `import`/`export` statements. Finally, all tests are now loaded correctly, rather than being included as scripts through the `font_test.html` file.
This commit is contained in:
parent
71a14be8e7
commit
6967b9dd96
8 changed files with 120 additions and 94 deletions
|
@ -14,12 +14,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
var base64alphabet =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function decodeFontData(base64) {
|
||||
var result = [];
|
||||
|
||||
|
@ -68,7 +65,6 @@ function encodeFontData(data) {
|
|||
return buffer;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function ttx(data, callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "/ttx");
|
||||
|
@ -89,10 +85,11 @@ function ttx(data, callback) {
|
|||
xhr.send(encodedData);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function verifyTtxOutput(output) {
|
||||
var m = /^<error>(.*?)<\/error>/.exec(output);
|
||||
if (m) {
|
||||
throw m[1];
|
||||
}
|
||||
}
|
||||
|
||||
export { decodeFontData, encodeFontData, ttx, verifyTtxOutput };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue