From 8271b6d8b29e34eceb19a532d067ca98dbc2135d Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 18 Jan 2024 15:44:29 -0500 Subject: [PATCH] more test details logged --- test/helpers/test.js | 13 +++++++++++++ test/modules/viewport.js | 29 ++++++++++++++++++----------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/test/helpers/test.js b/test/helpers/test.js index 60931bba..69a59162 100644 --- a/test/helpers/test.js +++ b/test/helpers/test.js @@ -146,6 +146,19 @@ obj0[member0](); assert.equal(called, true, 'called through for ' + member0); assert.equal(errored, true, 'errored for ' + member0); + }, + + logWebGLInfo: function(viewer){ + let drawers = [viewer.drawer, viewer.navigator && viewer.navigator.drawer]; + for(const drawer of drawers){ + if(!drawer){ + return; + } + let errors = drawer._numGlMaxTextureErrors; + let ok = drawer._numGlMaxTextureErrors; + errors === 0 ? console.log('No GL errors') : errors ? console.log(`GL errors: ${errors}`) : null; + ok === 0 ? console.log('No GL calls') : ok ? console.log(`GL calls: ${ok}`) : null; + } } }; diff --git a/test/modules/viewport.js b/test/modules/viewport.js index 47573ede..a9ba9f2a 100644 --- a/test/modules/viewport.js +++ b/test/modules/viewport.js @@ -22,17 +22,7 @@ }, afterEach: function () { if (viewer){ - let drawers = [viewer.drawer, viewer.navigator && viewer.navigator.drawer]; - for(const drawer of drawers){ - if(!drawer){ - return; - } - let errors = drawer._numGlMaxTextureErrors; - let ok = drawer._numGlMaxTextureErrors; - errors === 0 ? console.log('No GL errors') : errors ? console.log(`GL errors: ${errors}`) : null; - ok === 0 ? console.log('No GL calls') : ok ? console.log(`GL calls: ${ok}`) : null; - } - + Util.logWebGLInfo(viewer); viewer.destroy(); } @@ -91,6 +81,10 @@ springStiffness: SPRING_STIFFNESS }; + if (viewer){ + Util.logWebGLInfo(viewer); + viewer.destroy(); + } viewerConfig[config.property] = level; viewer = OpenSeadragon(viewerConfig); viewer.addOnceHandler('open', openHandler); @@ -107,6 +101,11 @@ }; viewerConfig[config.property] = level; + + if (viewer){ + Util.logWebGLInfo(viewer); + viewer.destroy(); + } viewer = OpenSeadragon(viewerConfig); viewer.addOnceHandler('open', openHandler); viewer.open(DZI_PATH); @@ -383,6 +382,10 @@ ); i++; if (i < testZoomLevels.length) { + if (viewer){ + Util.logWebGLInfo(viewer); + viewer.destroy(); + } viewer = OpenSeadragon({ id: VIEWER_ID, prefixUrl: PREFIX_URL, @@ -396,6 +399,10 @@ done(); } }; + if (viewer){ + Util.logWebGLInfo(viewer); + viewer.destroy(); + } viewer = OpenSeadragon({ id: VIEWER_ID, prefixUrl: PREFIX_URL,