From: Rick Waldron Date: Tue, 13 Sep 2011 21:34:13 +0000 (-0400) Subject: delete testFunction when done X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c2ea52433a54a16d66c1a99d0733a9ce620f89c4;p=popcorn-js.git delete testFunction when done --- diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 4a87994..6dfff8f 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -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 ); } ); });