Skip to content

Commit

Permalink
Add test for manual time tracking and dispose
Browse files Browse the repository at this point in the history
Make sure time and progress event synthesis is turned off after the tech is disposed.For videojs#1431.
  • Loading branch information
dmlap committed Aug 20, 2014
1 parent 342bdce commit a1eb8dd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/unit/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,21 @@ test('should synthesize progress events by default', function() {
clock.tick(500);
equal(progresses, 1, 'triggered one event');
});

test('dispose() should stop time tracking', function() {
var tech = new videojs.MediaTechController({
id: noop,
on: noop,
trigger: noop
});
tech.dispose();

// progress and timeupdate events will throw exceptions after the
// tech is disposed
try {
clock.tick(10 * 1000);
} catch (e) {
return equal(e, undefined, 'threw an exception');
}
ok(true, 'no exception was thrown');
});

0 comments on commit a1eb8dd

Please sign in to comment.