Getting started on a DZI-JSONp test; currently disabled

This commit is contained in:
Ian Gilman 2013-05-09 11:03:31 -07:00
parent 4f13328609
commit 05c25fddcf
3 changed files with 64 additions and 0 deletions

12
test/data/testpattern.js Normal file
View File

@ -0,0 +1,12 @@
testpattern({
Image: {
xmlns: 'http://schemas.microsoft.com/deepzoom/2008',
Format: 'jpg',
Overlap: 1,
TileSize: 254,
Size:{
Height: 1000,
Width: 1000
}
}
});

51
test/dzi-jsonp.js Normal file
View File

@ -0,0 +1,51 @@
(function() {
// TODO: How to know if a tile has been drawn? The tile-drawn event used below
// is defunct.
module('DZI JSONp');
var viewer = null;
// ----------
asyncTest('Open', function() {
$(document).ready(function() {
viewer = OpenSeadragon({
id: 'example',
prefixUrl: '/build/openseadragon/images/',
tileSources: '/test/data/testpattern.js'
});
ok(viewer, 'Viewer exists');
var openHandler = function(eventSender, eventData) {
viewer.removeHandler('open', openHandler);
ok(true, 'Open event was sent');
viewer.drawer.viewer = viewer;
viewer.addHandler('tile-drawn', tileDrawnHandler);
};
var tileDrawnHandler = function(eventSender, eventData) {
viewer.removeHandler('tile-drawn', tileDrawnHandler);
ok(true, 'A tile has been drawn');
start();
};
viewer.addHandler('open', openHandler);
});
});
// ----------
// asyncTest('Close', function() {
// var closeHandler = function() {
// viewer.removeHandler('close', closeHandler);
// $('#example').empty();
// ok(true, 'Close event was sent');
// start();
// };
// viewer.addHandler('close', closeHandler);
// viewer.close();
// });
})();

View File

@ -16,5 +16,6 @@
<script src="/build/openseadragon/openseadragon.min.js"></script>
<script src="/test/util.js"></script>
<script src="/test/basic.js"></script>
<!-- <script src="/test/dzi-jsonp.js"></script> -->
</body>
</html>