mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Fixed fullyLoaded test when run in browser
This commit is contained in:
parent
dd2f132577
commit
e6341ac1e0
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
testLog.reset();
|
testLog.reset();
|
||||||
|
|
||||||
|
// eslint-disable-next-line new-cap
|
||||||
viewer = OpenSeadragon({
|
viewer = OpenSeadragon({
|
||||||
id: 'example',
|
id: 'example',
|
||||||
prefixUrl: '/build/openseadragon/images/',
|
prefixUrl: '/build/openseadragon/images/',
|
||||||
@ -517,12 +518,17 @@
|
|||||||
var image = viewer.world.getItemAt(0);
|
var image = viewer.world.getItemAt(0);
|
||||||
assert.equal(image.getFullyLoaded(), false, 'not fully loaded at first');
|
assert.equal(image.getFullyLoaded(), false, 'not fully loaded at first');
|
||||||
|
|
||||||
|
// Zoom out enough that we don't start out with all the tiles loaded.
|
||||||
|
viewer.viewport.zoomBy(0.5, null, true);
|
||||||
|
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
var fullyLoadedChangeHandler = function(event) {
|
var fullyLoadedChangeHandler = function(event) {
|
||||||
if (count === 0) {
|
if (count === 0) {
|
||||||
assert.equal(event.fullyLoaded, true, 'event includes true fullyLoaded property');
|
assert.equal(event.fullyLoaded, true, 'event includes true fullyLoaded property');
|
||||||
assert.equal(image.getFullyLoaded(), true, 'image is fully loaded after event');
|
assert.equal(image.getFullyLoaded(), true, 'image is fully loaded after event');
|
||||||
|
|
||||||
|
// Zoom in enough that it needs to load some new tiles.
|
||||||
viewer.viewport.zoomBy(5, null, true);
|
viewer.viewport.zoomBy(5, null, true);
|
||||||
} else if (count === 1) {
|
} else if (count === 1) {
|
||||||
assert.equal(event.fullyLoaded, false, 'event includes false fullyLoaded property');
|
assert.equal(event.fullyLoaded, false, 'event includes false fullyLoaded property');
|
||||||
|
Loading…
Reference in New Issue
Block a user