From: Christopher De Cairos Date: Thu, 16 Jun 2011 21:54:54 +0000 (-0400) Subject: fixed tests X-Git-Tag: v0.7^2~31^2~5 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=5ea17346559c55a666e095a130559f7787311714;p=popcorn-js.git fixed tests --- diff --git a/plugins/processing/popcorn.processing.unit.js b/plugins/processing/popcorn.processing.unit.js index 83e63d7..2fc4813 100644 --- a/plugins/processing/popcorn.processing.unit.js +++ b/plugins/processing/popcorn.processing.unit.js @@ -71,20 +71,26 @@ test( "Processing plugin tests", function() { }); //check that three canvases were created - canvases = document.getElementsByTagName( "canvas" ); + canvases = document.querySelectorAll( "canvas" ); equals( canvases.length, 3, "Three canvases are present" ); plus(); + + var called = 0; - Popcorn.forEach( canvases, function( ctx ) { + //enable this when ticket #583 lands + //Popcorn.forEach( canvases, function( ctx, idx ) { + [].forEach.call( canvases, function( ctx ) { + var idCount = 0, i = -1, len = canvases.length; for ( ; ++i < len; ){ if ( ctx.id === canvases[ i ].id ) { idCount++; } } + equals( idCount, 1, ctx.id + " is a unique canvas id" ); plus(); - + equals( ctx.style.display, "none", ctx.id + " is hidden initially" ); plus(); });