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._requiresCanvasDrawerFallback = false;
|
||||
this._doRenderingTest();
|
||||
setTimeout(() => this._doRenderingTest(), 0); // defer this to the next event loop for tests
|
||||
}
|
||||
|
||||
// Public API required by all Drawer implementations
|
||||
@ -1335,6 +1335,10 @@
|
||||
* @returns
|
||||
*/
|
||||
_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
|
||||
if( testing ){
|
||||
return;
|
||||
@ -1362,7 +1366,7 @@
|
||||
testing = false;
|
||||
|
||||
// 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();
|
||||
if(div.parentNode){
|
||||
div.parentNode.removeChild(div);
|
||||
|
Loading…
Reference in New Issue
Block a user