clean up tests

This commit is contained in:
Tom 2024-01-10 12:13:00 -05:00
parent f3a90159c1
commit 58f918aaa1
21 changed files with 56 additions and 76 deletions

View File

@ -101,6 +101,24 @@ class CanvasDrawer extends $.DrawerBase{
this._drawTiles(tiledImage); this._drawTiles(tiledImage);
} }
} }
// // Fire the frame-drawn event.
// if( this.viewer ){
// /**
// * Raised when a tiled image is drawn to the canvas. Only valid
// * for webgl and canvas drawers.
// *
// * @event tiled-image-drawn
// * @memberof OpenSeadragon.Viewer
// * @type {object}
// * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.
// * @property {HTMLElement} canvas - The canvas which has been drawn onto
// * @property {?Object} userData - Arbitrary subscriber-defined object.
// */
// this.viewer.raiseEvent( 'frame-drawn', {
// canvas: this.canvas
// });
// }
} }
/** /**

View File

@ -380,6 +380,24 @@
this._outputContext.drawImage(this._renderingCanvas, 0, 0); this._outputContext.drawImage(this._renderingCanvas, 0, 0);
} }
// // Fire the frame-drawn event.
// if( this.viewer ){
// /**
// * Raised when a tiled image is drawn to the canvas. Only valid
// * for webgl and canvas drawers.
// *
// * @event tiled-image-drawn
// * @memberof OpenSeadragon.Viewer
// * @type {object}
// * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.
// * @property {HTMLElement} canvas - The canvas which has been drawn onto
// * @property {?Object} userData - Arbitrary subscriber-defined object.
// */
// this.viewer.raiseEvent( 'frame-drawn', {
// canvas: this.canvas
// });
// }
} }
// Public API required by all Drawer implementations // Public API required by all Drawer implementations

View File

@ -20,16 +20,6 @@
<div id="contentDiv" class="openseadragon1"></div> <div id="contentDiv" class="openseadragon1"></div>
<script type="text/javascript"> <script type="text/javascript">
const url = new URL(window.location.href);
let drawer = url.searchParams.get("drawer");
if (!drawer) {
drawer = 'canvas';
url.searchParams.set('drawer', drawer);
if ("undefined" !== typeof history.replaceState) {
history.replaceState(null, window.location.title, url.toString());
}
}
var viewer = OpenSeadragon({ var viewer = OpenSeadragon({
// debugMode: true, // debugMode: true,
id: "contentDiv", id: "contentDiv",

View File

@ -131,7 +131,8 @@
var box = new OpenSeadragon.Rect(margins.left, margins.top, var box = new OpenSeadragon.Rect(margins.left, margins.top,
$('#contentDiv').width() - (margins.left + margins.right), $('#contentDiv').width() - (margins.left + margins.right),
$('#contentDiv').height() - (margins.top + margins.bottom)); $('#contentDiv').height() - (margins.top + margins.bottom));
// if drawDebuggingRect is implemented, use it to show the box // If drawDebuggingRect is implemented, use it to show the box.
// This is not implemented by all drawers however.
self.viewer.drawer.drawDebuggingRect(box); self.viewer.drawer.drawDebuggingRect(box);
}); });
} }

View File

@ -80,12 +80,12 @@
// The changeover will look better if we wait for the first tile to be drawn. // The changeover will look better if we wait for the first tile to be drawn.
var tileDrawnHandler = function(event) { var tileDrawnHandler = function(event) {
if (event.tiledImage === fullImage) { if (event.tiledImage === fullImage) {
viewer.removeHandler('tiled-image-drawn', tileDrawnHandler); viewer.removeHandler('update-viewport', tileDrawnHandler);
viewer.world.removeItem(standin); viewer.world.removeItem(standin);
} }
}; };
viewer.addHandler('tiled-image-drawn', tileDrawnHandler); viewer.addHandler('update-viewport', tileDrawnHandler);
} }
}); });
} }

View File

@ -53,10 +53,7 @@
}); });
}, },
afterEach: function() { afterEach: function() {
if (viewer && viewer.close) { if (viewer){
viewer.close();
}
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }

View File

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

View File

@ -19,9 +19,6 @@
if (viewer && viewer.close) { if (viewer && viewer.close) {
viewer.close(); viewer.close();
} }
// if (viewer && viewer.destroy){
// viewer.destroy();
// }
viewer = null; viewer = null;
} }

View File

@ -10,10 +10,7 @@
testLog.reset(); testLog.reset();
}, },
afterEach: function () { afterEach: function () {
if (viewer && viewer.close) { if (viewer){
viewer.close();
}
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }
viewer = null; viewer = null;

View File

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

View File

@ -14,10 +14,7 @@
document.getElementById("qunit-fixture").appendChild(example); document.getElementById("qunit-fixture").appendChild(example);
}, },
afterEach: function () { afterEach: function () {
if ( viewer && viewer.close ) { if (viewer){
viewer.close();
}
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }

View File

@ -15,10 +15,7 @@
testLog.reset(); testLog.reset();
}, },
afterEach: function () { afterEach: function () {
if (viewer && viewer.close) { if (viewer){
viewer.close();
}
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }

View File

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

View File

@ -42,10 +42,7 @@
resetTestVariables(); resetTestVariables();
// if ( viewer && viewer.close ) { if (viewer){
// viewer.close();
// }
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }

View File

@ -16,10 +16,8 @@
}, },
afterEach: function() { afterEach: function() {
resetTestVariables(); resetTestVariables();
if ( viewer && viewer.close ) {
viewer.close(); if (viewer){
}
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }

View File

@ -10,10 +10,7 @@
testLog.reset(); testLog.reset();
}, },
afterEach: function () { afterEach: function () {
if (viewer && viewer.close) { if (viewer){
viewer.close();
}
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }

View File

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

View File

@ -130,10 +130,7 @@
afterEach: function () { afterEach: function () {
ASSERT = null; ASSERT = null;
if (viewer && viewer.close) { if (viewer){
viewer.close();
}
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }

View File

@ -19,10 +19,7 @@
}); });
}, },
afterEach: function () { afterEach: function () {
if (viewer && viewer.close) { if (viewer){
viewer.close();
}
if (viewer && viewer.destroy){
viewer.destroy(); viewer.destroy();
} }

View File

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

View File

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