DZI-JSONp test now works; enabled

This commit is contained in:
Ian Gilman 2013-05-10 11:32:43 -07:00
parent c6f8b5e192
commit 457f908c06
2 changed files with 19 additions and 14 deletions

View File

@ -1,8 +1,5 @@
(function() { (function() {
// TODO: How to know if a tile has been drawn? The tile-drawn event used below
// is defunct.
module('DZI JSONp'); module('DZI JSONp');
var viewer = null; var viewer = null;
@ -22,12 +19,20 @@
viewer.removeHandler('open', openHandler); viewer.removeHandler('open', openHandler);
ok(true, 'Open event was sent'); ok(true, 'Open event was sent');
viewer.drawer.viewer = viewer; viewer.drawer.viewer = viewer;
timeout = setTimeout(function() {
viewer.removeHandler('tile-drawn', tileDrawnHandler);
ok(false, 'taking too long');
start();
}, 2000);
viewer.addHandler('tile-drawn', tileDrawnHandler); viewer.addHandler('tile-drawn', tileDrawnHandler);
}; };
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');
clearTimeout(timeout);
start(); start();
}; };
@ -36,16 +41,16 @@
}); });
// ---------- // ----------
// asyncTest('Close', function() { asyncTest('Close', function() {
// var closeHandler = function() { var closeHandler = function() {
// viewer.removeHandler('close', closeHandler); viewer.removeHandler('close', closeHandler);
// $('#example').empty(); $('#example').empty();
// ok(true, 'Close event was sent'); ok(true, 'Close event was sent');
// start(); start();
// }; };
// viewer.addHandler('close', closeHandler); viewer.addHandler('close', closeHandler);
// viewer.close(); viewer.close();
// }); });
})(); })();

View File

@ -16,6 +16,6 @@
<script src="/build/openseadragon/openseadragon.min.js"></script> <script src="/build/openseadragon/openseadragon.min.js"></script>
<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/dzi-jsonp.js"></script> --> <script src="/test/dzi-jsonp.js"></script>
</body> </body>
</html> </html>