mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
clean up tests
This commit is contained in:
parent
f3a90159c1
commit
58f918aaa1
@ -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
|
||||||
|
// });
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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
|
||||||
|
@ -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",
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -53,10 +53,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
afterEach: function() {
|
afterEach: function() {
|
||||||
if (viewer && viewer.close) {
|
if (viewer){
|
||||||
viewer.close();
|
|
||||||
}
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,10 +16,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
afterEach: function () {
|
afterEach: function () {
|
||||||
if (viewer && viewer.close) {
|
if (viewer){
|
||||||
viewer.close();
|
|
||||||
}
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
test/modules/controls.js
vendored
3
test/modules/controls.js
vendored
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -17,10 +17,7 @@
|
|||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
afterEach: function () {
|
afterEach: function () {
|
||||||
if ( viewer && viewer.close ) {
|
if (viewer){
|
||||||
viewer.close();
|
|
||||||
}
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,10 +16,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
afterEach: function() {
|
afterEach: function() {
|
||||||
if ( viewer && viewer.close ) {
|
if (viewer){
|
||||||
viewer.close();
|
|
||||||
}
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,10 +42,7 @@
|
|||||||
|
|
||||||
resetTestVariables();
|
resetTestVariables();
|
||||||
|
|
||||||
// if ( viewer && viewer.close ) {
|
if (viewer){
|
||||||
// viewer.close();
|
|
||||||
// }
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,10 +17,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
afterEach: function() {
|
afterEach: function() {
|
||||||
if (viewer && viewer.close) {
|
if (viewer){
|
||||||
viewer.close();
|
|
||||||
}
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +19,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
afterEach: function () {
|
afterEach: function () {
|
||||||
if (viewer && viewer.close) {
|
if (viewer){
|
||||||
viewer.close();
|
|
||||||
}
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,10 +21,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
afterEach: function () {
|
afterEach: function () {
|
||||||
if (viewer && viewer.close) {
|
if (viewer){
|
||||||
viewer.close();
|
|
||||||
}
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,10 +16,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
afterEach: function () {
|
afterEach: function () {
|
||||||
if (viewer && viewer.close) {
|
if (viewer){
|
||||||
viewer.close();
|
|
||||||
}
|
|
||||||
if (viewer && viewer.destroy){
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user