From 9a28793e6455954f5f47bcebafd93df00d39239c Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Tue, 18 Jun 2013 11:08:33 -0700 Subject: [PATCH] Testing source and timer management in basic test --- test/basic.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/basic.js b/test/basic.js index ea4e9aad..a336e25b 100644 --- a/test/basic.js +++ b/test/basic.js @@ -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);