mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
update to help tests pass
This commit is contained in:
parent
e128ff3a72
commit
a392ea673a
@ -111,7 +111,7 @@
|
|||||||
this.context = this._outputContext; // API required by tests
|
this.context = this._outputContext; // API required by tests
|
||||||
|
|
||||||
this._requiresCanvasDrawerFallback = false;
|
this._requiresCanvasDrawerFallback = false;
|
||||||
this._doRenderingTest();
|
setTimeout(() => this._doRenderingTest(), 0); // defer this to the next event loop for tests
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public API required by all Drawer implementations
|
// Public API required by all Drawer implementations
|
||||||
@ -1335,6 +1335,10 @@
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
_doRenderingTest(){
|
_doRenderingTest(){
|
||||||
|
// Don't do the test if this drawer has already been destroyed
|
||||||
|
if( this._destroyed ){
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Avoid infinite call stack by only testing once
|
// Avoid infinite call stack by only testing once
|
||||||
if( testing ){
|
if( testing ){
|
||||||
return;
|
return;
|
||||||
@ -1362,7 +1366,7 @@
|
|||||||
testing = false;
|
testing = false;
|
||||||
|
|
||||||
// Clean up the test viewer when the main viewer is destroyed (if it hasn't been already)
|
// Clean up the test viewer when the main viewer is destroyed (if it hasn't been already)
|
||||||
testViewer.addOnceHandler('before-destroy', () => {
|
this.viewer.addOnceHandler('before-destroy', () => {
|
||||||
testViewer.destroy();
|
testViewer.destroy();
|
||||||
if(div.parentNode){
|
if(div.parentNode){
|
||||||
div.parentNode.removeChild(div);
|
div.parentNode.removeChild(div);
|
||||||
|
Loading…
Reference in New Issue
Block a user