cleaned up additional viewers in tests

This commit is contained in:
Tom 2024-01-18 16:05:35 -05:00
parent 8271b6d8b2
commit a2d31e9610
14 changed files with 29 additions and 46 deletions

View File

@ -27,6 +27,7 @@
};
var viewer = null;
var DONE = false;
var OriginalLoader = OpenSeadragon.ImageLoader;
var OriginalAjax = OpenSeadragon.makeAjaxRequest;
@ -156,7 +157,7 @@
ASSERT = null;
if (viewer && viewer.close) {
viewer.close();
DONE ? viewer.destroy () : viewer.close();
}
viewer = null;
@ -271,6 +272,7 @@
return "d1=a1&d2=a2###";
},
}, true, true);
DONE = true; // mark the module as completed so the viewer can be destroyed
});
})();

View File

@ -17,7 +17,6 @@
},
afterEach: function () {
if (viewer){
viewer.destroy();
}

View File

@ -18,7 +18,6 @@
},
afterEach: function () {
if (viewer){
viewer.destroy();
}
viewer = null;

View File

@ -15,7 +15,6 @@
},
afterEach: function () {
if (viewer){
viewer.destroy();
}

View File

@ -16,7 +16,6 @@
},
afterEach: function () {
if (viewer){
viewer.destroy();
}

View File

@ -22,7 +22,6 @@
},
afterEach: function() {
if (viewer){
viewer.destroy();
}

View File

@ -43,7 +43,6 @@
resetTestVariables();
if (viewer){
viewer.destroy();
}

View File

@ -11,7 +11,6 @@
},
afterEach: function () {
if (viewer){
viewer.destroy();
}

View File

@ -21,7 +21,6 @@
},
afterEach: function() {
if (viewer){
viewer.destroy();
}

View File

@ -137,7 +137,6 @@
ASSERT = null;
if (viewer){
viewer.destroy();
}

View File

@ -20,7 +20,6 @@
},
afterEach: function () {
if (viewer){
viewer.destroy();
}

View File

@ -26,17 +26,9 @@
afterEach: function () {
if (viewer1){
let errors = viewer1.drawer._numGlMaxTextureErrors;
if(errors > 0){
console.log('Number of times MAX_TEXTURE_IMAGE_UNITS had a bad value:', errors);
}
viewer1.destroy();
}
if (viewer2){
let errors = viewer2.drawer._numGlMaxTextureErrors;
if(errors > 0){
console.log('Number of times MAX_TEXTURE_IMAGE_UNITS had a bad value:', errors);
}
viewer2.destroy();
}
viewer1 = viewer2 = null;

View File

@ -8,7 +8,7 @@
var SPRING_STIFFNESS = 100; // Faster animation = faster tests
var EPSILON = 0.0000000001;
QUnit.module.only("viewport", {
QUnit.module("viewport", {
beforeEach: function () {
$('<div id="example"></div>').appendTo("#qunit-fixture");
@ -22,7 +22,7 @@
},
afterEach: function () {
if (viewer){
Util.logWebGLInfo(viewer);
// Util.logWebGLInfo(viewer);
viewer.destroy();
}
@ -82,7 +82,7 @@
};
if (viewer){
Util.logWebGLInfo(viewer);
// Util.logWebGLInfo(viewer);
viewer.destroy();
}
viewerConfig[config.property] = level;
@ -103,7 +103,7 @@
viewerConfig[config.property] = level;
if (viewer){
Util.logWebGLInfo(viewer);
// Util.logWebGLInfo(viewer);
viewer.destroy();
}
viewer = OpenSeadragon(viewerConfig);
@ -383,7 +383,7 @@
i++;
if (i < testZoomLevels.length) {
if (viewer){
Util.logWebGLInfo(viewer);
// Util.logWebGLInfo(viewer);
viewer.destroy();
}
viewer = OpenSeadragon({
@ -400,7 +400,7 @@
}
};
if (viewer){
Util.logWebGLInfo(viewer);
// Util.logWebGLInfo(viewer);
viewer.destroy();
}
viewer = OpenSeadragon({

View File

@ -17,7 +17,6 @@
},
afterEach: function () {
if (viewer){
viewer.destroy();
}