From: rwldrn Date: Thu, 17 Feb 2011 21:50:16 +0000 (-0500) Subject: [#349] Fixes unit tests by removing the exec callback when the test is complete;... X-Git-Tag: v0.4~46^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=dde350cacab9092600b9c7381cd1d5ad4e545536;p=popcorn-js.git [#349] Fixes unit tests by removing the exec callback when the test is complete; removes dead test comment block; --- diff --git a/popcorn.js b/popcorn.js index 1bd7278..c42a5d8 100644 --- a/popcorn.js +++ b/popcorn.js @@ -473,13 +473,8 @@ } this.data.events[type] = null; + return this; - }, - special: { - // handles timeline controllers - play: function () { - // renders all of the interally stored track commands - } } } }; diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 5db3bb2..72963e0 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -182,7 +182,13 @@ test("exec", function () { expect(expects); function plus(){ - if ( ++count == expects ) start(); + if ( ++count == expects ) { + + popped.unlisten( "timeupdate", "execCallback" ); + + + start(); + } } stop( 10000 ); @@ -1480,113 +1486,3 @@ test("Last Check", function () { }); -/* - - - - - - - -test("Events Extended", function () { - - QUnit.reset(); - - // needs expectation - - var popped = Popcorn("#video"), - expects = 11, - count = 0; - - expect(expects); - // not in full use - function plus(){ - if ( ++count == expects ) start(); - } - - stop( 10000 ); - - - Popcorn.plugin("extendedEvents", (function () { - - var fired = []; - - var pluginObj = { - - start: function() { - - }, - end: function() { - - } - }; - - $.each( Setup.events, function ( k, type ) { - - pluginObj[type] = function (event, opts) { - - if ( fired.indexOf(type) === -1 ) { - fired.push(type); - - ok( true, type + " fired" ); - - plus(); - - - - } - }; - - }); - - return pluginObj; - - })()); - - - - - popped.extendedEvents({ - - start: 20, - end: 21 - - }); - - - popped.currentTime(19).play(); - - $.each( Setup.events, function ( k, type ) { - - popped.trigger(type); - - }); - -}); -*/ - -/* -module("Popcorn Video Object") -test("wait()", function () { - - //QUnit.reset(); - - // needs expectation - - var popped = Popcorn("#video"), - startat = +new Date(); - - - - - popped.play().wait(2).exec(function () { - - console.log( +new Date() - startat ); - - ok(true) - - }).pause(); - - -}); -*/