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