mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Move the XRefMock
in the unit tests to a central location
This patch helps to avoid code duplication for this mock since more unit tests are depending on it.
This commit is contained in:
parent
783d42ec2b
commit
ab820438ae
5 changed files with 39 additions and 80 deletions
|
@ -18,16 +18,9 @@ import { OperatorList, PartialEvaluator } from '../../src/core/evaluator';
|
|||
import { Stream, StringStream } from '../../src/core/stream';
|
||||
import { OPS } from '../../src/shared/util';
|
||||
import { WorkerTask } from '../../src/core/worker';
|
||||
import { XRefMock } from './test_utils';
|
||||
|
||||
describe('evaluator', function() {
|
||||
function XrefMock(queue) {
|
||||
this.queue = queue || [];
|
||||
}
|
||||
XrefMock.prototype = {
|
||||
fetchIfRef() {
|
||||
return this.queue.shift();
|
||||
},
|
||||
};
|
||||
function HandlerMock() {
|
||||
this.inputs = [];
|
||||
}
|
||||
|
@ -63,7 +56,7 @@ describe('evaluator', function() {
|
|||
beforeAll(function(done) {
|
||||
partialEvaluator = new PartialEvaluator({
|
||||
pdfManager: new PdfManagerMock(),
|
||||
xref: new XrefMock(),
|
||||
xref: new XRefMock(),
|
||||
handler: new HandlerMock(),
|
||||
pageIndex: 0,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue