mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Fix tests.
This commit is contained in:
parent
62c96ebad7
commit
fbcf78c894
@ -105,7 +105,8 @@
|
||||
orig = config.getOrig(config.testArray[i], viewport);
|
||||
expected = config.getExpected(orig, viewport);
|
||||
actual = viewport[config.method](orig);
|
||||
propEqual(
|
||||
var assert = config.assert || propEqual;
|
||||
assert(
|
||||
actual,
|
||||
expected,
|
||||
"Correctly converted coordinates " + orig
|
||||
@ -118,6 +119,10 @@
|
||||
viewer.open(DZI_PATH);
|
||||
};
|
||||
|
||||
function assertPointsEquals(actual, expected, message) {
|
||||
Util.assertPointsEquals(actual, expected, 1e-15, message);
|
||||
}
|
||||
|
||||
// Tests start here.
|
||||
|
||||
asyncTest('getContainerSize', function() {
|
||||
@ -872,7 +877,8 @@
|
||||
getExpected: function(orig, viewport) {
|
||||
return orig.divide(viewer.source.dimensions.x);
|
||||
},
|
||||
method: 'imageToViewportCoordinates'
|
||||
method: 'imageToViewportCoordinates',
|
||||
assert: assertPointsEquals
|
||||
});
|
||||
});
|
||||
|
||||
@ -885,7 +891,8 @@
|
||||
getExpected: function(orig, viewport) {
|
||||
return orig.divide(ZOOM_FACTOR * viewport.getContainerSize().x);
|
||||
},
|
||||
method: 'imageToViewportCoordinates'
|
||||
method: 'imageToViewportCoordinates',
|
||||
assert: assertPointsEquals
|
||||
});
|
||||
});
|
||||
asyncTest('imageToViewportRectangle', function() {
|
||||
@ -902,7 +909,8 @@
|
||||
orig.height / viewer.source.dimensions.x
|
||||
);
|
||||
},
|
||||
method: 'imageToViewportRectangle'
|
||||
method: 'imageToViewportRectangle',
|
||||
assert: assertPointsEquals
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user