]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
removed globalSize tests from the core unit tests [#720]
authorChristopher De Cairos <chris.decairos@gmail.com>
Thu, 15 Sep 2011 15:09:55 +0000 (11:09 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Thu, 15 Sep 2011 15:09:55 +0000 (11:09 -0400)
test/index.html
test/popcorn.unit.js
test/popcorn.unit.setup.js

index dd533c38a38bb3c2103e3a51df8b23e113995078..99a9c44552976824b686c1e99b95b6df581c6954 100644 (file)
@@ -5,15 +5,9 @@
   <link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
   <script src="jquery.js"></script>
 
-
   <script src="qunit/qunit.js"></script>
 
-  <!--
-    do not move - this must be called immediately prior to
-    popcorn-api-draft.js
-  -->
   <script src="popcorn.unit.setup.js"></script>
-
   <script src="../popcorn.js"></script>
   <script src="popcorn.unit.js"></script>
 </head>
@@ -21,7 +15,7 @@
   <h1 id="qunit-header">
     Popcorn.js API
     <iframe id="archaic-tests" data-src="archaic.html" style="width:325px;height:60px;float:right;border:0px;margin:-10px 20px 0 -10px;background:#fff" ></iframe>
-    
+
     <iframe id="butter-tests" data-src="butter_test.html" style="width:325px;height:60px;float:right;border:0px;margin:-10px 20px 0 -10px;background:#fff" ></iframe>
 
     <iframe id="ready-tests" data-src="ready.html" style="width:325px;height:60px;float:right;border:0px;margin:-10px 20px 0 -10px;background:#fff" ></iframe>
   <ol id="qunit-tests"></ol>
   <div id="qunit-fixture">
 
-
-
-
-
   </div>
 
   <video id='video'
@@ -61,9 +51,6 @@
     <source src="italia.ogg" type='audio/ogg; codecs="vorbis"'>
   </audio>
 
-
-
-
   <!-- Position Tests Adapted From jQuery offsets/dimensions Tests -->
   <style type="text/css" media="screen">
     #position-tests { display:none;margin:0; position: fixed;top:0px;left:0px;  }
index 6dfff8f4996c8d8ecd5150f130ac1e8564ec6b5d..da0e3606a11f8c7e6c9ba49bb7953c49e793a514 100644 (file)
@@ -1,7 +1,7 @@
 module("Popcorn API");
 test("API", function() {
 
-  var expects = 4,
+  var expects = 3,
       count = 0;
 
   expect(expects);
@@ -26,14 +26,6 @@ test("API", function() {
 
   } catch (e) {};
 
-  try {
-
-    equals( Setup.getGlobalSize(), Setup.globalSize + 1 , "Popcorn API creates only 1 global reference");
-    plus();
-
-  } catch (e) {};
-
-
   try {
 
     Popcorn(function() {
@@ -3679,29 +3671,3 @@ test("Parser Support", function() {
 
   });
 });
-
-
-module("Popcorn Test Runner End");
-test("Last Check", function() {
-
-  //   ALWAYS RUN LAST
-  try {
-
-    equals( Setup.getGlobalSize(), Setup.globalSize + 1 , "Popcorn API did not leak");
-
-    if ( !Setup.globalDiff.length ) {
-      //console.log(Setup.globalDiff);
-    }
-
-  } catch (e) {};
-
-  //  Trigger follow-up tests to run in iframes
-  (function( $ ) {
-
-    $("iframe[data-src]").attr( "src", function() {
-      return $(this).data("src");
-    });
-
-  })( jQuery );
-
-});
index e69f3db60a1a788fc95286d5f820208a6d75f8f5..7f1d11acdc72873ad43004eba1a73d4023f296f0 100644 (file)
@@ -4,46 +4,7 @@ if ( !window[ "console" ] ) {
 
 (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, prop;
-
-    for ( prop in window ) {
-      if ( prop !== "_firebug" ) {
-        size++;
-
-        if ( !Setup.hasRun ) {
-          Setup.globalCache.push( prop );
-        } else {
-          if ( Setup.globalCache.indexOf( prop ) === -1 ) {
-            Setup.globalDiff.push( prop );
-          }
-        }
-      }
-    }
-
-    //  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;
-  };
+  var Setup = {};
 
   Setup.eventset = "loadstart progress suspend emptied stalled play pause " +
                    "loadedmetadata loadeddata waiting playing canplay canplaythrough " +
@@ -54,5 +15,3 @@ if ( !window[ "console" ] ) {
   global.Setup = Setup;
 
 })( window );
-
-Setup.getGlobalSize();
\ No newline at end of file