1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #15880 from Snuffleupagus/rm-docStats

[api-minor] Remove the `PDFDocumentProxy.stats` getter (PR 15758 follow-up)
This commit is contained in:
Jonas Jenwald 2023-01-02 16:03:53 +01:00 committed by GitHub
commit 42aa08563b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 163 additions and 322 deletions

View file

@ -17,7 +17,6 @@ import {
AnnotationMode,
AnnotationType,
createPromiseCapability,
FontType,
ImageKind,
InvalidPDFException,
MissingPDFException,
@ -25,7 +24,6 @@ import {
PasswordException,
PasswordResponses,
PermissionFlag,
StreamType,
UnknownErrorException,
} from "../../src/shared/util.js";
import {
@ -1846,11 +1844,6 @@ describe("api", function () {
expect(downloadInfo).toEqual({ length: basicApiFileLength });
});
it("gets document stats", async function () {
const stats = pdfDocument.stats;
expect(stats).toEqual(null);
});
it("cleans up document resources", async function () {
await pdfDocument.cleanup();
@ -2761,24 +2754,6 @@ Caron Broadcasting, Inc., an Ohio corporation (“Lessee”).`)
await loadingTask.destroy();
});
it("gets document stats after parsing page", async function () {
await page.getOperatorList();
const stats = pdfDocument.stats;
const expectedStreamTypes = {
[StreamType.FLATE]: true,
};
const expectedFontTypes = {
[FontType.TYPE1STANDARD]: true,
[FontType.CIDFONTTYPE2]: true,
};
expect(stats).toEqual({
streamTypes: expectedStreamTypes,
fontTypes: expectedFontTypes,
});
});
it("gets page stats after parsing page, without `pdfBug` set", async function () {
await page.getOperatorList();
expect(page.stats).toEqual(null);

View file

@ -16,7 +16,6 @@
import { NullStream, StringStream } from "../../src/core/stream.js";
import { Page, PDFDocument } from "../../src/core/document.js";
import { assert } from "../../src/shared/util.js";
import { DocStats } from "../../src/core/core_utils.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { Ref } from "../../src/core/primitives.js";
@ -77,7 +76,6 @@ function buildGetDocumentParams(filename, options) {
class XRefMock {
constructor(array) {
this._map = Object.create(null);
this.stats = new DocStats({ send: () => {} });
this._newTemporaryRefNum = null;
this._newPersistentRefNum = null;
this.stream = new NullStream();