test canvas and webgl drawers in multi-image

This commit is contained in:
Tom 2024-01-11 14:42:11 -05:00
parent e0fd78344b
commit f563600635
2 changed files with 260 additions and 254 deletions

View File

@ -7,7 +7,7 @@
function runDrawerTests(drawerType){
QUnit.module('Drawer', {
QUnit.module('Drawer-'+drawerType, {
beforeEach: function () {
$('<div id="example"></div>').appendTo("#qunit-fixture");
@ -34,7 +34,7 @@
};
// ----------
QUnit.test('basics-'+drawerType, function(assert) {
QUnit.test('basics', function(assert) {
var done = assert.async();
createViewer();
assert.ok(viewer.drawer, 'Drawer exists');
@ -43,7 +43,7 @@
});
// ----------
QUnit.test('rotation-'+drawerType, function(assert) {
QUnit.test('rotation', function(assert) {
var done = assert.async();
createViewer({
@ -70,7 +70,7 @@
});
// ----------
QUnit.test('debug-'+drawerType, function(assert) {
QUnit.test('debug', function(assert) {
var done = assert.async();
createViewer({
tileSources: '/test/data/testpattern.dzi',
@ -89,7 +89,7 @@
});
// ----------
QUnit.test('sketchCanvas-'+drawerType, function(assert) {
QUnit.test('sketchCanvas', function(assert) {
var done = assert.async();
createViewer({
@ -137,7 +137,7 @@
});
// ----------
QUnit.test('deprecations-'+drawerType, function(assert) {
QUnit.test('deprecations', function(assert) {
var done = assert.async();
createViewer({

View File

@ -2,8 +2,12 @@
( function() {
var viewer;
const drawerTypes = ['webgl','canvas'];
drawerTypes.forEach(runDrawerTests);
QUnit.module( 'Multi-Image', {
function runDrawerTests(drawerType){
QUnit.module( 'Multi-Image-'+drawerType, {
beforeEach: function() {
$( '<div id="example"></div>' ).appendTo( "#qunit-fixture" );
@ -12,7 +16,8 @@
viewer = OpenSeadragon( {
id: 'example',
prefixUrl: '/build/openseadragon/images/',
springStiffness: 100 // Faster animation = faster tests
springStiffness: 100, // Faster animation = faster tests
drawer: drawerType
});
},
afterEach: function() {
@ -278,5 +283,6 @@
};
}
});
}
})();