From c2ea52433a54a16d66c1a99d0733a9ce620f89c4 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 13 Sep 2011 17:34:13 -0400 Subject: [PATCH] delete testFunction when done --- test/popcorn.unit.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) 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 ); } ); }); -- 2.43.0