[Editor] Move setting window.uiManager back to the test code
In PR #18574 setting `window.uiManager` was moved into the `src` folder to avoid intermittent integration test failures because at the time we lacked a way to register event listeners early (before PDF.js loads). However, in PR #18617 this functionality got introduced, so we can now use the new way of setting up the event bus in the tests to move this back to the `test` folder again and to reduce the amount of test-only code in the main codebase as discussed in PR #18574. Partially reverts e037c5711d3d2413669e9b6c275986adf24a295b.
This commit is contained in:
parent
b47c7eca83
commit
db06011032
@ -806,7 +806,6 @@ class AnnotationEditorUIManager {
|
|||||||
this.isShiftKeyDown = false;
|
this.isShiftKeyDown = false;
|
||||||
|
|
||||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
|
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
|
||||||
window.uiManager = this;
|
|
||||||
Object.defineProperty(this, "reset", {
|
Object.defineProperty(this, "reset", {
|
||||||
value: () => {
|
value: () => {
|
||||||
this.selectAll();
|
this.selectAll();
|
||||||
|
|||||||
@ -990,7 +990,13 @@ describe("Highlight Editor", () => {
|
|||||||
"tracemonkey.pdf",
|
"tracemonkey.pdf",
|
||||||
".annotationEditorLayer",
|
".annotationEditorLayer",
|
||||||
null,
|
null,
|
||||||
null,
|
{
|
||||||
|
eventBusSetup: eventBus => {
|
||||||
|
eventBus.on("annotationeditoruimanager", ({ uiManager }) => {
|
||||||
|
window.uiManager = uiManager;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
highlightEditorColors: "red=#AB0000",
|
highlightEditorColors: "red=#AB0000",
|
||||||
supportsCaretBrowsingMode: true,
|
supportsCaretBrowsingMode: true,
|
||||||
|
|||||||
@ -832,7 +832,13 @@ describe("Stamp Editor", () => {
|
|||||||
"empty.pdf",
|
"empty.pdf",
|
||||||
".annotationEditorLayer",
|
".annotationEditorLayer",
|
||||||
null,
|
null,
|
||||||
null,
|
{
|
||||||
|
eventBusSetup: eventBus => {
|
||||||
|
eventBus.on("annotationeditoruimanager", ({ uiManager }) => {
|
||||||
|
window.uiManager = uiManager;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
enableAltText: true,
|
enableAltText: true,
|
||||||
enableUpdatedAddImage: true,
|
enableUpdatedAddImage: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user