From: Christopher De Cairos Date: Thu, 23 Jun 2011 17:59:12 +0000 (-0400) Subject: compressed while loop in unit tests, added call to exit() on the processing instance... X-Git-Tag: v0.7^2~18^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=9781dc75060d25b123cc99ed80dffbf8ec7c9bd4;p=popcorn-js.git compressed while loop in unit tests, added call to exit() on the processing instance in the teardown. --- diff --git a/plugins/processing/popcorn.processing.js b/plugins/processing/popcorn.processing.js index ae849e6..708ae9a 100644 --- a/plugins/processing/popcorn.processing.js +++ b/plugins/processing/popcorn.processing.js @@ -158,6 +158,7 @@ }, _teardown: function( options ) { + options.pjsInstance && options.pjsInstance.exit(); options.parentTarget && options.parentTarget.removeChild( options.canvas ); } }; diff --git a/plugins/processing/popcorn.processing.unit.js b/plugins/processing/popcorn.processing.unit.js index e68c6be..a4a40c7 100644 --- a/plugins/processing/popcorn.processing.unit.js +++ b/plugins/processing/popcorn.processing.unit.js @@ -98,12 +98,10 @@ test( "Processing plugin tests", function() { equals( processingDiv4.children[ 0 ].style.display, "inline", "canvas '" + processingDiv4.children[ 0 ].id + "' is displayed" ); plus(); }).exec( 4.5, function() { - var idx = 5, div, id; + var idx = 5; while ( --idx ) { - div = document.getElementById( "processing-div-" + ( idx ) ); - id = trackids.pop(); - popped.removeTrackEvent( id ); - ok ( !div.children[0], "track event was removed" ); + popped.removeTrackEvent( trackids.pop() ); + ok ( !document.getElementById( "processing-div-" + ( idx ) ).children[ 0 ], "track event was removed" ); plus(); } });