mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
The default `page.type()` API from Puppeteer works for text fields that only dispatch a sandbox event on e.g. focus loss (i.e. after all characters have been inserted), and for those we can also use the default typing delay from Puppeteer instead of defining our own value. However, it doesn't work correctly for text fields where every character insertion dispatches a sandbox event. This is because processing the sandbox event takes some time and Puppeteer must wait for that before it can (safely) insert the next character. This commit therefore introduces a helper function to type a given value correctly in such text fields. Not only does this fix intermittent failures if our delay was too low for sandbox processing to complete, but it also speeds up the tests by eliminating our delays in places where they were (much) higher than necessary. In total the runtime of the scripting integration test suite goes from 137 seconds before this patch to 100 seconds after this patch. |
||
---|---|---|
.. | ||
chromium | ||
font | ||
fuzz | ||
images | ||
integration | ||
pdfs | ||
resources | ||
stats | ||
types | ||
unit | ||
.eslintrc | ||
.gitignore | ||
add_test.mjs | ||
annotation_layer_builder_overrides.css | ||
downloadutils.mjs | ||
draw_layer_test.css | ||
driver.js | ||
integration-boot.mjs | ||
test.mjs | ||
test_manifest.json | ||
test_slave.html | ||
testutils.mjs | ||
text_layer_test.css | ||
webserver.mjs | ||
xfa_layer_builder_overrides.css |