mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 07:38:07 +02:00
[api-minor] Add a (static) PDFWorker.getWorkerSrc
method that returns the current workerSrc
This method returns the currently used `workerSrc`, which thus allows obtaining the fallback `workerSrc` value (e.g. when the option wasn't set by the user).
This commit is contained in:
parent
c56f3f04dd
commit
a5aaf62754
2 changed files with 10 additions and 1 deletions
|
@ -24,7 +24,7 @@ import {
|
|||
DOMCanvasFactory, RenderingCancelledException
|
||||
} from '../../src/display/dom_utils';
|
||||
import {
|
||||
getDocument, PDFDocumentProxy, PDFPageProxy
|
||||
getDocument, PDFDocumentProxy, PDFPageProxy, PDFWorker
|
||||
} from '../../src/display/api';
|
||||
import isNodeJS from '../../src/shared/is_node';
|
||||
import { PDFJS } from '../../src/display/global';
|
||||
|
@ -405,6 +405,11 @@ describe('api', function() {
|
|||
done.fail(reason);
|
||||
});
|
||||
});
|
||||
it('gets current workerSrc', function() {
|
||||
let workerSrc = PDFWorker.getWorkerSrc();
|
||||
expect(typeof workerSrc).toEqual('string');
|
||||
expect(workerSrc).toEqual(PDFJS.workerSrc);
|
||||
});
|
||||
});
|
||||
describe('PDFDocument', function() {
|
||||
var loadingTask;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue