From 0ad5e38f8f20b0c72b4ee22f2045caa21f71939f Mon Sep 17 00:00:00 2001 From: rwldrn Date: Wed, 16 Feb 2011 14:45:43 -0500 Subject: [PATCH] [#349] Update exec unit tests to reflect Popcorn.events internals change --- popcorn.js | 7 +++++-- test/popcorn.unit.js | 24 +++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/popcorn.js b/popcorn.js index 9f63c0c..1bd7278 100644 --- a/popcorn.js +++ b/popcorn.js @@ -337,10 +337,13 @@ callback.fired = true; - this.unlisten("timeupdate", guid ); - fn.call(self, event); + setTimeout(function() { + + callback.fired = false; + + }, 500 ); } }; diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index c1660c1..5db3bb2 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -175,7 +175,9 @@ test("exec", function () { var popped = Popcorn("#video"), expects = 2, - count = 0; + count = 0, + hasLooped = false, + loop = 0; expect(expects); @@ -184,22 +186,18 @@ test("exec", function () { } stop( 10000 ); - - popped.exec( 4, function () { - - - ok(true, "exec callback fired"); - plus(); - - - equal( popped.data.events.timeupdate, null, "exec callback removed"); + ok(true, "exec callback fired " + loop++ ); plus(); - + + if ( !hasLooped ) { + + popped.currentTime(3).play(); + + hasLooped = true; + } }).currentTime(3).play(); - - }); -- 2.43.0