mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Generalized format test and added DZI XML
This commit is contained in:
parent
4182b5e5ba
commit
9001fe9a5e
1
test/data/testpattern.xml
Normal file
1
test/data/testpattern.xml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><Image TileSize="254" Overlap="1" Format="jpg" xmlns="http://schemas.microsoft.com/deepzoom/2008"><Size Width="1000" Height="1000"/></Image>
|
@ -1,18 +1,21 @@
|
|||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
module('DZI JSONp');
|
// This module tests whether our various file formats can be opened.
|
||||||
|
// TODO: Add more file formats (with corresponding test data).
|
||||||
|
|
||||||
|
module('Formats');
|
||||||
|
|
||||||
var viewer = null;
|
var viewer = null;
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
asyncTest('Open', function() {
|
var testOpen = function(name) {
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var timeWatcher = Util.timeWatcher();
|
var timeWatcher = Util.timeWatcher();
|
||||||
|
|
||||||
viewer = OpenSeadragon({
|
viewer = OpenSeadragon({
|
||||||
id: 'example',
|
id: 'example',
|
||||||
prefixUrl: '/build/openseadragon/images/',
|
prefixUrl: '/build/openseadragon/images/',
|
||||||
tileSources: '/test/data/testpattern.js'
|
tileSources: '/test/data/' + name
|
||||||
});
|
});
|
||||||
|
|
||||||
ok(viewer, 'Viewer exists');
|
ok(viewer, 'Viewer exists');
|
||||||
@ -27,24 +30,34 @@
|
|||||||
var tileDrawnHandler = function(eventSender, eventData) {
|
var tileDrawnHandler = function(eventSender, eventData) {
|
||||||
viewer.removeHandler('tile-drawn', tileDrawnHandler);
|
viewer.removeHandler('tile-drawn', tileDrawnHandler);
|
||||||
ok(true, 'A tile has been drawn');
|
ok(true, 'A tile has been drawn');
|
||||||
|
viewer.addHandler('close', closeHandler);
|
||||||
|
viewer.close();
|
||||||
|
};
|
||||||
|
|
||||||
|
var closeHandler = function() {
|
||||||
|
viewer.removeHandler('close', closeHandler);
|
||||||
|
$('#example').empty();
|
||||||
|
ok(true, 'Close event was sent');
|
||||||
timeWatcher.done();
|
timeWatcher.done();
|
||||||
};
|
};
|
||||||
|
|
||||||
viewer.addHandler('open', openHandler);
|
viewer.addHandler('open', openHandler);
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
asyncTest('DZI', function() {
|
||||||
|
testOpen('testpattern.dzi');
|
||||||
});
|
});
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
asyncTest('Close', function() {
|
asyncTest('DZI JSONp', function() {
|
||||||
var closeHandler = function() {
|
testOpen('testpattern.js');
|
||||||
viewer.removeHandler('close', closeHandler);
|
|
||||||
$('#example').empty();
|
|
||||||
ok(true, 'Close event was sent');
|
|
||||||
start();
|
|
||||||
};
|
|
||||||
|
|
||||||
viewer.addHandler('close', closeHandler);
|
|
||||||
viewer.close();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
asyncTest('DZI XML', function() {
|
||||||
|
testOpen('testpattern.xml');
|
||||||
|
});
|
||||||
|
|
||||||
})();
|
})();
|
@ -17,6 +17,6 @@
|
|||||||
<script src="/test/util.js"></script>
|
<script src="/test/util.js"></script>
|
||||||
<script src="/test/basic.js"></script>
|
<script src="/test/basic.js"></script>
|
||||||
<script src="/test/strings.js"></script>
|
<script src="/test/strings.js"></script>
|
||||||
<script src="/test/dzi-jsonp.js"></script>
|
<script src="/test/formats.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user