From e037c5711d3d2413669e9b6c275986adf24a295b Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Wed, 7 Aug 2024 18:06:14 +0200 Subject: [PATCH] [Editor] Add the uiManager to the window object when testing --- src/display/editor/tools.js | 1 + test/integration/highlight_editor_spec.mjs | 12 +----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/display/editor/tools.js b/src/display/editor/tools.js index 59381da66e34f..888672d59d61b 100644 --- a/src/display/editor/tools.js +++ b/src/display/editor/tools.js @@ -817,6 +817,7 @@ class AnnotationEditorUIManager { this.isShiftKeyDown = false; if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) { + window.uiManager = this; Object.defineProperty(this, "reset", { value: () => { this.selectAll(); diff --git a/test/integration/highlight_editor_spec.mjs b/test/integration/highlight_editor_spec.mjs index c61663e0330f4..635c81843a9c1 100644 --- a/test/integration/highlight_editor_spec.mjs +++ b/test/integration/highlight_editor_spec.mjs @@ -997,17 +997,7 @@ describe("Highlight Editor", () => { "tracemonkey.pdf", ".annotationEditorLayer", null, - async page => { - await page.evaluate(async () => { - await window.PDFViewerApplication.initializedPromise; - window.PDFViewerApplication.eventBus.on( - "annotationeditoruimanager", - ({ uiManager }) => { - window.uiManager = uiManager; - } - ); - }); - }, + null, { highlightEditorColors: "red=#AB0000", supportsCaretBrowsingMode: true,