From: Rick Waldron Date: Mon, 26 Sep 2011 16:07:58 +0000 (-0400) Subject: [#737] Test re-write X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=342d26c48d3b58fdba04b7a6610a92c3c2481ac4;p=popcorn-js.git [#737] Test re-write --- diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 8cbe755..841707b 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -1904,7 +1904,7 @@ test("timeUpdate add track event while paused", function() { var $pop = Popcorn( "#video" ), count = 0, - expects = 3; + expects = 1; expect( expects ); @@ -1915,40 +1915,25 @@ test("timeUpdate add track event while paused", function() { } } - Popcorn.plugin("timeUpdateTester", function() { + stop(); + + Popcorn.plugin( "timeUpdateTester", function() { return { start: function () { - var div = document.createElement("div"); - div.id = "timeUpdate-test"; - - document.body.appendChild(div); + ok( true, "timeupdater ran while paused"); + plus(); }, end: function () { - document.getElementById("timeUpdate-test").parentNode.removeChild(document.getElementById("timeUpdate-test")); } }; }); - stop(); - $pop.currentTime( 1 ).pause(); - - equals( $pop.getTrackEvents().length, 0, "Initially no trackEvents" ); - plus(); + $pop.currentTime( 1 ).pause() $pop.timeUpdateTester({ - id: "timeUpdateID", start: 1, - end: 1 + end: 2 }); - - equals( $pop.getTrackEvents().length, 1, "trackEvent successfully added" ); - plus(); - - ok( document.getElementById( "timeUpdate-test" ), "trackEvent successfully added, content was displayed while video was paused" ); - plus(); - - $pop.removeTrackEvent( "timeUpdateID" ); - }); test("Plugin Factory", function () {