Allow to set up a hook at the end of the initialization (bug 1881319)#17709
Allow to set up a hook at the end of the initialization (bug 1881319)#17709calixteman wants to merge 1 commit into
Conversation
With this patch it's now possible to be sure to add a listener (for example for the "pagerendered" event) before the pdf is set.
Snuffleupagus
left a comment
There was a problem hiding this comment.
Is it really not possible utilize an existing event, or perhaps even the PDFViewerApplication.initializedPromise promise, rather than having to add all of this new complexity here?
Also, in case it's helpful, please keep in mind that you can determine if tests are running in mozilla-central via the isInAutomation-property which is already available in the viewer through AppOptions.
All-in-all this code unfortunately does not feel all that readable/maintainable, and looking at the description here and in Bugzilla it still feels a bit like the "bigger picture" isn't entirely clear to me!?
|
The goal is to have some tests for the snap package of Firefox and they're using Selenium. |
How is the PDF viewer being loaded in this case, because it might be possible to work-around that? Anyway, could we at least avoid adding a new Preference for this and keep it as "just" an option? Edit: Another possibility to avoid the Preference, assuming that [1] Since that event is dispatched before the viewer-initialization runs. |
|
Closing in favor of #18617 which only requires changing test code and overall seems safer/simpler. |
With this patch it's now possible to be sure to add a listener (for example for the "pagerendered" event) before the pdf is set.