1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-27 02:43:45 +02:00

Add test for manual time tracking and dispose

Make sure time and progress event synthesis is turned off after the tech is disposed.For #1431.
This commit is contained in:
David LaPalomento 2014-08-20 14:39:02 -04:00
parent 342bdce748
commit a1eb8dd975

View File

@ -115,3 +115,21 @@ test('should synthesize progress events by default', function() {
clock.tick(500); clock.tick(500);
equal(progresses, 1, 'triggered one event'); 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');
});