]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
delete testFunction when done
authorRick Waldron <waldron.rick@gmail.com>
Tue, 13 Sep 2011 21:34:13 +0000 (17:34 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Tue, 13 Sep 2011 21:34:13 +0000 (17:34 -0400)
test/popcorn.unit.js

index 4a87994a2c52b02d5f3a9a10c86fb7edc3399233..6dfff8f4996c8d8ecd5150f130ac1e8564ec6b5d 100644 (file)
@@ -3219,6 +3219,7 @@ test("Popcorn.getScript()", function() {
   function plus() {
     if ( ++count === expects ) {
       start();
+      delete window["testFunction"];
     }
   }
 
@@ -3281,18 +3282,18 @@ test("Popcorn.getScript()", function() {
   );
 
 
-       var cb = function( id ) {
-               if ( window.testFunction ) {
-                       ok( true, "testFunction called by plugin id#: " + id );
-                       plus();
-               } else {
-                       ok( false, "testFunction called by plugin id#: " + id );
-                       plus();
-               }
-       }
+  var cb = function( id ) {
+    if ( window.testFunction ) {
+      ok( true, "testFunction called by plugin id#: " + id );
+      plus();
+    } else {
+      ok( false, "testFunction called by plugin id#: " + id );
+      plus();
+    }
+  }
 
-       Popcorn.getScript( "data/testfunction.js", function() { cb( 1 ); } );
-       Popcorn.getScript( "data/testfunction.js", function() { cb( 2 ); } );
+  Popcorn.getScript( "data/testfunction.js", function() { cb( 1 ); } );
+  Popcorn.getScript( "data/testfunction.js", function() { cb( 2 ); } );
 });