<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>
<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'
<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; }
module("Popcorn API");
test("API", function() {
- var expects = 4,
+ var expects = 3,
count = 0;
expect(expects);
} catch (e) {};
- try {
-
- equals( Setup.getGlobalSize(), Setup.globalSize + 1 , "Popcorn API creates only 1 global reference");
- plus();
-
- } catch (e) {};
-
-
try {
Popcorn(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 );
-
-});
(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 " +
global.Setup = Setup;
})( window );
-
-Setup.getGlobalSize();
\ No newline at end of file