]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
compressed while loop in unit tests, added call to exit() on the processing instance... t589
authorChristopher De Cairos <chris.decairos@gmail.com>
Thu, 23 Jun 2011 17:59:12 +0000 (13:59 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Thu, 23 Jun 2011 17:59:12 +0000 (13:59 -0400)
plugins/processing/popcorn.processing.js
plugins/processing/popcorn.processing.unit.js

index ae849e683c51331c12c97c4a773e30424e24be88..708ae9aa2849d31d6d8655eab4dc2692cf95ec1e 100644 (file)
       },
       
       _teardown: function( options ) {
+        options.pjsInstance && options.pjsInstance.exit();
         options.parentTarget && options.parentTarget.removeChild( options.canvas );
       }
     };
index e68c6be7d601badc03e10d146561fc7803fbeee9..a4a40c79a671eac333c3f2fc6323a571c8a90110 100644 (file)
@@ -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();
     }
   });