diff --git a/src/pdf.js b/src/pdf.js index 9921e324b..064ae6c61 100644 --- a/src/pdf.js +++ b/src/pdf.js @@ -80,6 +80,12 @@ const pdfjsVersion = const pdfjsBuild = typeof PDFJSDev !== "undefined" ? PDFJSDev.eval("BUNDLE_BUILD") : void 0; +if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) { + globalThis.pdfjsTestingUtils = { + Outliner, + }; +} + export { AbortException, AnnotationEditorLayer, @@ -109,7 +115,6 @@ export { noContextMenu, normalizeUnicode, OPS, - Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString, diff --git a/test/driver.js b/test/driver.js index aaeb20d58..8b26975f9 100644 --- a/test/driver.js +++ b/test/driver.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals pdfjsLib, pdfjsViewer */ +/* globals pdfjsLib, pdfjsTestingUtils, pdfjsViewer */ const { AnnotationLayer, @@ -20,12 +20,12 @@ const { DrawLayer, getDocument, GlobalWorkerOptions, - Outliner, PixelsPerInch, shadow, TextLayer, XfaLayer, } = pdfjsLib; +const { Outliner } = pdfjsTestingUtils; const { GenericL10n, parseQueryString, SimpleLinkService } = pdfjsViewer; const WAITING_TIME = 100; // ms diff --git a/test/unit/pdf_spec.js b/test/unit/pdf_spec.js index accced555..7e2224c8d 100644 --- a/test/unit/pdf_spec.js +++ b/test/unit/pdf_spec.js @@ -61,7 +61,6 @@ import { AnnotationLayer } from "../../src/display/annotation_layer.js"; import { ColorPicker } from "../../src/display/editor/color_picker.js"; import { DrawLayer } from "../../src/display/draw_layer.js"; import { GlobalWorkerOptions } from "../../src/display/worker_options.js"; -import { Outliner } from "../../src/display/editor/outliner.js"; import { TextLayer } from "../../src/display/text_layer.js"; import { XfaLayer } from "../../src/display/xfa_layer.js"; @@ -94,7 +93,6 @@ const expectedAPI = Object.freeze({ noContextMenu, normalizeUnicode, OPS, - Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString, diff --git a/web/pdfjs.js b/web/pdfjs.js index 8b8cde016..ad709d936 100644 --- a/web/pdfjs.js +++ b/web/pdfjs.js @@ -42,7 +42,6 @@ const { noContextMenu, normalizeUnicode, OPS, - Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString, @@ -89,7 +88,6 @@ export { noContextMenu, normalizeUnicode, OPS, - Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString,