Merge pull request #12036 from Snuffleupagus/test-renderTaskOnContinue
Add at least *some* test-coverage for the `RenderTask.onContinue` functionality
This commit is contained in:
commit
3359739ffe
@ -22,6 +22,7 @@ const CMAP_URL = "../external/bcmaps/";
|
|||||||
const CMAP_PACKED = true;
|
const CMAP_PACKED = true;
|
||||||
const IMAGE_RESOURCES_PATH = "/web/images/";
|
const IMAGE_RESOURCES_PATH = "/web/images/";
|
||||||
const WORKER_SRC = "../build/generic/build/pdf.worker.js";
|
const WORKER_SRC = "../build/generic/build/pdf.worker.js";
|
||||||
|
const RENDER_TASK_ON_CONTINUE_DELAY = 5; // ms
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class
|
* @class
|
||||||
@ -626,7 +627,15 @@ var Driver = (function DriverClosure() {
|
|||||||
};
|
};
|
||||||
initPromise
|
initPromise
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return page.render(renderContext).promise.then(function () {
|
const renderTask = page.render(renderContext);
|
||||||
|
|
||||||
|
if (task.renderTaskOnContinue) {
|
||||||
|
renderTask.onContinue = function (cont) {
|
||||||
|
// Slightly delay the continued rendering.
|
||||||
|
setTimeout(cont, RENDER_TASK_ON_CONTINUE_DELAY);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return renderTask.promise.then(function () {
|
||||||
completeRender(false);
|
completeRender(false);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
@ -11,6 +11,13 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "tracemonkey-renderTaskOnContinue",
|
||||||
|
"file": "pdfs/tracemonkey.pdf",
|
||||||
|
"md5": "9a192d8b1a7dc652a19835f6f08098bd",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"renderTaskOnContinue": true
|
||||||
|
},
|
||||||
{ "id": "tracemonkey-fbf",
|
{ "id": "tracemonkey-fbf",
|
||||||
"file": "pdfs/tracemonkey.pdf",
|
"file": "pdfs/tracemonkey.pdf",
|
||||||
"md5": "9a192d8b1a7dc652a19835f6f08098bd",
|
"md5": "9a192d8b1a7dc652a19835f6f08098bd",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user