From a1eb8dd975c20702e9af07ebdad89f307037efc0 Mon Sep 17 00:00:00 2001 From: David LaPalomento Date: Wed, 20 Aug 2014 14:39:02 -0400 Subject: [PATCH] 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. --- test/unit/media.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/unit/media.js b/test/unit/media.js index 46c128702..cf83b5271 100644 --- a/test/unit/media.js +++ b/test/unit/media.js @@ -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'); +});