Testing source and timer management in basic test

This commit is contained in:
Ian Gilman 2013-06-18 11:08:33 -07:00
parent 862b560cb4
commit 9a28793e64

View File

@ -24,6 +24,8 @@
equal(eventSender, viewer, 'Sender of open event was viewer');
ok(eventData, 'Handler also received event data');
ok(viewer.viewport, 'Viewport exists');
ok(viewer.source, 'source exists');
ok(viewer._updateRequestId, 'timer is on');
start();
};
@ -122,9 +124,14 @@
asyncTest('Close', function() {
var closeHandler = function() {
viewer.removeHandler('close', closeHandler);
ok(!viewer.source, 'no source');
$('#example').empty();
ok(true, 'Close event was sent');
start();
ok(!viewer._updateRequestId, 'timer is off');
setTimeout(function() {
ok(!viewer._updateRequestId, 'timer is still off');
start();
}, 100);
};
viewer.addHandler('close', closeHandler);