From: Anna Sobiepanek Date: Mon, 14 Feb 2011 22:15:14 +0000 (-0500) Subject: updating popcorn.unit.setup.js X-Git-Tag: v0.4~52 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b57ecb164826a961dc48b42a72417145308dadd6;p=popcorn-js.git updating popcorn.unit.setup.js --- diff --git a/test/popcorn.unit.setup.js b/test/popcorn.unit.setup.js index 79f4a1c..ebfa253 100644 --- a/test/popcorn.unit.setup.js +++ b/test/popcorn.unit.setup.js @@ -1,74 +1,74 @@ -// suppress console log errors -if ( !window['console'] ) { - var console = {}, - methods = 'log debug info warn error exception assert dir dirxml trace group groupEnd groupCollapsed time timeEnd profile profileEnd count clear notifyFirebug getFirebugElement firebug element'.split(' '); - - for ( var m in methods ) { - console[ methods[m] ] = function () { - //Array.prototype.slice.call(arguments) - }; - } -} - - -(function (global) { - - // Store the number of global properties that exist prior to Popcorn API definition - - var Setup = { - hasRun: false, - globalSize: 0, - globalCache: [], - globalDiff: [] - }; - - Setup.getGlobalSize = function() { - - var size = 0; - - for( var p in window ) { - if ( p !== "_firebug" ) { - size++; - - if ( !Setup.hasRun ) { - Setup.globalCache.push( p ); - } else { - if ( Setup.globalCache.indexOf( p ) === -1 ) { - Setup.globalDiff.push( p ); - } - } - } - } - - // account for self - size++; - - // Store the number of global properties internally - if ( !Setup.globalSize ) { - Setup.globalSize = size; - } - - if ( !Setup.hasRun ) { - Setup.hasRun = true; - } - - return size; - }; - - - - Setup.eventset = "loadstart progress suspend emptied stalled play pause " + - "loadedmetadata loadeddata waiting playing canplay canplaythrough " + - "seeking seeked timeupdate ended ratechange durationchange volumechange"; - - Setup.events = Setup.eventset.split(/\s+/g); - - - - global.Setup = Setup; - -})(window); - - -Setup.getGlobalSize(); - +// suppress console log errors +if ( !window['console'] ) { + var console = {}, + methods = 'log debug info warn error exception assert dir dirxml trace group groupEnd groupCollapsed time timeEnd profile profileEnd count clear notifyFirebug getFirebugElement firebug element'.split(' '); + + for ( var m in methods ) { + console[ methods[m] ] = function () { + //Array.prototype.slice.call(arguments) + }; + } +} + + +(function (global) { + + // Store the number of global properties that exist prior to Popcorn API definition + + var Setup = { + hasRun: false, + globalSize: 0, + globalCache: [], + globalDiff: [] + }; + + Setup.getGlobalSize = function() { + + var size = 0; + + for( var p in window ) { + if ( p !== "_firebug" ) { + size++; + + if ( !Setup.hasRun ) { + Setup.globalCache.push( p ); + } else { + if ( Setup.globalCache.indexOf( p ) === -1 ) { + Setup.globalDiff.push( p ); + } + } + } + } + + // account for self + size++; + + // Store the number of global properties internally + if ( !Setup.globalSize ) { + Setup.globalSize = size; + } + + if ( !Setup.hasRun ) { + Setup.hasRun = true; + } + + return size; + }; + + + + Setup.eventset = "loadstart progress suspend emptied stalled play pause " + + "loadedmetadata loadeddata waiting playing canplay canplaythrough " + + "seeking seeked timeupdate ended ratechange durationchange volumechange"; + + Setup.events = Setup.eventset.split(/\s+/g); + + + + global.Setup = Setup; + +})(window); + + +Setup.getGlobalSize(); +