renamed complete test runner, added runners for each type, made core tests index.html again. [#1045]

This commit is contained in:
Christopher De Cairos 2012-05-04 14:29:59 -04:00
Родитель 6bd784a073
Коммит add4fb2c90
13 изменённых файлов: 391 добавлений и 124 удалений

20
modules/index.html Normal file
Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Popcorn Modules Test Runner</title>
<link rel="stylesheet" href="../test/qunit/qunit.css" type="text/css" media="screen">
<script src="../test/jquery.js"></script>
<script src="../test/tests-modules.js"></script>
<script src="../test/popcorn.testrunner.js"></script>
</head>
<body>
<h1 id="qunit-header">
Popcorn.js Modules Test Runner
</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<iframe id="test-frame" style="height: 600px; width: 100%; overflow: scroll;"></iframe>
</body>
</html>

20
parsers/index.html Normal file
Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Popcorn Parsers Test Runner</title>
<link rel="stylesheet" href="../test/qunit/qunit.css" type="text/css" media="screen">
<script src="../test/jquery.js"></script>
<script src="../test/tests-parsers.js"></script>
<script src="../test/popcorn.testrunner.js"></script>
</head>
<body>
<h1 id="qunit-header">
Popcorn.js Parsers Test Runner
</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<iframe id="test-frame" style="height: 600px; width: 100%; overflow: scroll;"></iframe>
</body>
</html>

20
players/index.html Normal file
Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Popcorn Players Test Runner</title>
<link rel="stylesheet" href="../test/qunit/qunit.css" type="text/css" media="screen">
<script src="../test/jquery.js"></script>
<script src="../test/tests-players.js"></script>
<script src="../test/popcorn.testrunner.js"></script>
</head>
<body>
<h1 id="qunit-header">
Popcorn.js Players Test Runner
</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<iframe id="test-frame" style="height: 600px; width: 100%; overflow: scroll;"></iframe>
</body>
</html>

20
plugins/index.html Normal file
Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Popcorn Plug-in Test Runner</title>
<link rel="stylesheet" href="../test/qunit/qunit.css" type="text/css" media="screen">
<script src="../test/jquery.js"></script>
<script src="../test/tests-plugins.js"></script>
<script src="../test/popcorn.testrunner.js"></script>
</head>
<body>
<h1 id="qunit-header">
Popcorn.js Plug-in Test Runner
</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<iframe id="test-frame" style="height: 600px; width: 100%; overflow: scroll;"></iframe>
</body>
</html>

Просмотреть файл

@ -1,19 +1,116 @@
<!DOCTYPE html>
<html>
<head>
<title>Popcorn Test Suite Runner</title>
<title>Popcorn API</title>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
<script src="jquery.js"></script>
<script src="tests.js"></script>
<script src="popcorn.testrunner.js"></script>
<script src="qunit/qunit.js"></script>
<script src="popcorn.unit.setup.js"></script>
<script src="../popcorn.js"></script>
<script src="popcorn.unit.js"></script>
<script src="inject.js"></script>
<script src="popcorn.inject.js"></script>
</head>
<body>
<h1 id="qunit-header">
Popcorn.js Test Suite
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>
</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<iframe id="test-frame" style="height: 600px; width: 100%; overflow: scroll;"></iframe>
<div id="qunit-fixture">
<div class="contextual" data-contextual="true">This should break the tests</div>
<div id="popcorn-dom-find-context">
<div id="inside-context" class="contextual" data-contextual="true">This element will be found when its parent is used as a context</div>
</div>
</div>
<video id="video" class="dom-tests" data-custom="foo"
style="display:;width:300px"
controls
preload="auto">
<source id="mp4"
src="trailer.mp4"
type='video/mp4; codecs="avc1, mp4a"'>
<source id="ogv"
src="trailer.ogv"
type='video/ogg; codecs="theora, vorbis"'>
<source id="webm"
src="trailer.webm"
type='video/webm; codecs="vp8, vorbis"'>
<p>Your user agent does not support the HTML5 Video element.</p>
</video>
<audio id="audio" data-timeline-sources="data/parserData.json" controls>
<source src="italia.mp4" type='audio/mp4; codecs="mp4a.40.2"'>
<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; }
div.absolute { position: absolute; margin: 0px; width: 100px; height: 100px; background: #fff; }
#absolute-1 { top: 0; left: 0; }
#absolute-1-1 { top: 1px; left: 1px; }
#absolute-1-1-1 { top: 1px; left: 1px; }
#absolute-2 { top: 19px; left: 19px; }
div.relative { position: relative; top: 0; left: 0; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#relative-2 { top: 20px; left: 20px; }
div.fixed { position: fixed; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#fixed-1 { top: 0; left: 0; }
#fixed-2 { top: 20px; left: 20px; }
div.static { position: static; top: 0; left: 0; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#static-2 { top: 20px; left: 20px; }
</style>
<div id="position-tests">
<div id="absolute-1" class="absolute"><video id="vid-absolute-1" src="trailer.ogv" style="visibility:hidden"></video>
<div id="absolute-1-1" class="absolute"><video id="vid-absolute-1-1"" src="trailer.ogv" style="visibility:hidden"></video>
<div id="absolute-1-1-1" class="absolute"><video id="vid-absolute-1-1-1" src="trailer.ogv" style="visibility:hidden"></video></div>
</div>
</div>
<div id="absolute-2" class="absolute"><video id="vid-absolute-2" src="trailer.ogv" style="visibility:hidden"></video></div>
<div id="relative-1" class="relative"><video id="vid-relative-1" src="trailer.ogv" style="visibility:hidden"></video>
<div id="relative-1-1" class="relative"><video id="vid-relative-1-1" src="trailer.ogv" style="visibility:hidden"></video>
<div id="relative-1-1-1" class="relative"><video id="vid-relative-1-1-1" src="trailer.ogv" style="visibility:hidden"></video></div>
</div>
</div>
<div id="relative-2" class="relative"><video id="vid-relative-2" src="trailer.ogv" style="visibility:hidden"></video></div>
<div id="fixed-1" class="fixed"><video id="vid-fixed-1" src="trailer.ogv" style="visibility:hidden"></video></div>
<div id="fixed-2" class="fixed"><video id="vid-fixed-2" src="trailer.ogv" style="visibility:hidden"></video></div>
<div id="static-1" class="static"><video id="vid-static-1" src="trailer.ogv" style="visibility:hidden">
<div id="static-1-1" class="static"><video id="vid-static-1-1" src="trailer.ogv" style="visibility:hidden">
<div id="static-1-1-1" class="static"><video id="vid-static-1-1-1" src="trailer.ogv" style="visibility:hidden"></div>
</div>
</div>
<div id="static-2" class="static"><video id="vid-static-2" src="trailer.ogv" style="visibility:hidden"></div>
</div>
</body>
</html>
</html>

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Popcorn Test Suite Runner</title>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
<script src="jquery.js"></script>
<script src="tests.js"></script>
<script src="popcorn.testrunner.js"></script>
</head>
<body>
<h1 id="qunit-header">
Popcorn.js Test Suite
</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<iframe id="test-frame" style="height: 600px; width: 100%; overflow: scroll;"></iframe>
</body>
</html>

Просмотреть файл

@ -16,7 +16,12 @@ $(function() {
main_li = create( "li" ),
main_b = create( "b" ),
currentTest = tests[ index ],
results_arr = [];
results_arr = [],
userAgent = id( "qunit-userAgent" );
if ( userAgent ) {
userAgent.innerHTML = navigator.userAgent;
};
window.addEventListener( "message", function( e ) {
var message = JSON.parse( e.data )[0],
@ -102,6 +107,8 @@ $(function() {
// Finish test suite; display totals
$( testFrame ).remove();
id( "qunit-banner" ).className = totalFail ? "qunit-fail" : "qunit-pass";
var banner = create( "p" ),
html = [
'Tests completed in ',

Просмотреть файл

@ -1,116 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Popcorn API</title>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
<script src="jquery.js"></script>
<script src="qunit/qunit.js"></script>
<script src="popcorn.unit.setup.js"></script>
<script src="../popcorn.js"></script>
<script src="popcorn.unit.js"></script>
<script src="inject.js"></script>
<script src="popcorn.inject.js"></script>
</head>
<body>
<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>
</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">
<div class="contextual" data-contextual="true">This should break the tests</div>
<div id="popcorn-dom-find-context">
<div id="inside-context" class="contextual" data-contextual="true">This element will be found when its parent is used as a context</div>
</div>
</div>
<video id="video" class="dom-tests" data-custom="foo"
style="display:;width:300px"
controls
preload="auto">
<source id="mp4"
src="trailer.mp4"
type='video/mp4; codecs="avc1, mp4a"'>
<source id="ogv"
src="trailer.ogv"
type='video/ogg; codecs="theora, vorbis"'>
<source id="webm"
src="trailer.webm"
type='video/webm; codecs="vp8, vorbis"'>
<p>Your user agent does not support the HTML5 Video element.</p>
</video>
<audio id="audio" data-timeline-sources="data/parserData.json" controls>
<source src="italia.mp4" type='audio/mp4; codecs="mp4a.40.2"'>
<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; }
div.absolute { position: absolute; margin: 0px; width: 100px; height: 100px; background: #fff; }
#absolute-1 { top: 0; left: 0; }
#absolute-1-1 { top: 1px; left: 1px; }
#absolute-1-1-1 { top: 1px; left: 1px; }
#absolute-2 { top: 19px; left: 19px; }
div.relative { position: relative; top: 0; left: 0; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#relative-2 { top: 20px; left: 20px; }
div.fixed { position: fixed; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#fixed-1 { top: 0; left: 0; }
#fixed-2 { top: 20px; left: 20px; }
div.static { position: static; top: 0; left: 0; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#static-2 { top: 20px; left: 20px; }
</style>
<div id="position-tests">
<div id="absolute-1" class="absolute"><video id="vid-absolute-1" src="trailer.ogv" style="visibility:hidden"></video>
<div id="absolute-1-1" class="absolute"><video id="vid-absolute-1-1"" src="trailer.ogv" style="visibility:hidden"></video>
<div id="absolute-1-1-1" class="absolute"><video id="vid-absolute-1-1-1" src="trailer.ogv" style="visibility:hidden"></video></div>
</div>
</div>
<div id="absolute-2" class="absolute"><video id="vid-absolute-2" src="trailer.ogv" style="visibility:hidden"></video></div>
<div id="relative-1" class="relative"><video id="vid-relative-1" src="trailer.ogv" style="visibility:hidden"></video>
<div id="relative-1-1" class="relative"><video id="vid-relative-1-1" src="trailer.ogv" style="visibility:hidden"></video>
<div id="relative-1-1-1" class="relative"><video id="vid-relative-1-1-1" src="trailer.ogv" style="visibility:hidden"></video></div>
</div>
</div>
<div id="relative-2" class="relative"><video id="vid-relative-2" src="trailer.ogv" style="visibility:hidden"></video></div>
<div id="fixed-1" class="fixed"><video id="vid-fixed-1" src="trailer.ogv" style="visibility:hidden"></video></div>
<div id="fixed-2" class="fixed"><video id="vid-fixed-2" src="trailer.ogv" style="visibility:hidden"></video></div>
<div id="static-1" class="static"><video id="vid-static-1" src="trailer.ogv" style="visibility:hidden">
<div id="static-1-1" class="static"><video id="vid-static-1-1" src="trailer.ogv" style="visibility:hidden">
<div id="static-1-1-1" class="static"><video id="vid-static-1-1-1" src="trailer.ogv" style="visibility:hidden"></div>
</div>
</div>
<div id="static-2" class="static"><video id="vid-static-2" src="trailer.ogv" style="visibility:hidden"></div>
</div>
</body>
</html>

19
test/tests-modules.js Normal file
Просмотреть файл

@ -0,0 +1,19 @@
var tests = [{
name: "Locale",
path: "./locale/popcorn.locale.unit.html",
type: "Module"
}, {
name: "Player",
path: "./player/popcorn.player.unit.html",
type: "Module"
}, {
name: "Parser",
path: "./parser/popcorn.parser.unit.html",
type: "Module"
}, {
name: "Timeline-sources",
path: "./timeline-sources/popcorn.timeline-sources.unit.html",
type: "Module"
}
];

35
test/tests-parsers.js Normal file
Просмотреть файл

@ -0,0 +1,35 @@
var tests = [{
name: "JSON Parser",
path: "./parserJSON/popcorn.parserJSON.unit.html",
type: "Parser"
}, {
name: "SBV Parser",
path: "./parserSBV/popcorn.parserSBV.unit.html",
type: "Parser"
}, {
name: "SSA Parser",
path: "./parserSSA/popcorn.parserSSA.unit.html",
type: "Parser"
}, {
name: "SRT Parser",
path: "./parserSRT/popcorn.parserSRT.unit.html",
type: "Parser"
}, {
name: "TTML Parser",
path: "./parserTTML/popcorn.parserTTML.unit.html",
type: "Parser"
}, {
name: "TTXT Parser",
path: "./parserTTXT/popcorn.parserTTXT.unit.html",
type: "Parser"
}, {
name: "XML Parser",
path: "./parserXML/popcorn.parserXML.unit.html",
type: "Parser"
}, {
name: "VTT Parser",
path: "./parserVTT/popcorn.parserVTT.unit.html",
type: "Parser"
}
];

18
test/tests-players.js Normal file
Просмотреть файл

@ -0,0 +1,18 @@
var tests = [
//disabled until fixed
//{
//name: "Youtube",
//path: "./youtube/popcorn.youtube.unit.html",
//type: "Player"
//},
{
name: "Vimeo Player",
path: "./vimeo/popcorn.vimeo.unit.html",
type: "Player"
}, {
name: "Soundcloud",
path: "./soundcloud/popcorn.soundcloud.unit.html",
type: "Player"
}
];

107
test/tests-plugins.js Normal file
Просмотреть файл

@ -0,0 +1,107 @@
var tests = [{
name: "Attribution",
path: "./attribution/popcorn.attribution.unit.html",
type: "Plugin"
}, {
name: "DocumentCloud",
path: "./documentcloud/popcorn.documentcloud.unit.html",
type: "Plugin"
}, {
name: "Flickr",
path: "./flickr/popcorn.flickr.unit.html",
type: "Plugin"
}, {
name: "GML",
path: "./gml/popcorn.gml.unit.html",
type: "Plugin"
}, {
name: "GoogleMap",
path: "./googlemap/popcorn.googlemap.unit.html",
type: "Plugin"
}, {
name: "Rdio",
path: "./rdio/popcorn.rdio.unit.html",
type: "Plugin"
}, {
name: "Linkedin",
path: "./linkedin/popcorn.linkedin.unit.html",
type: "Plugin"
}, {
name: "TagThisPerson",
path: "./tagthisperson/popcorn.tagthisperson.unit.html",
type: "Plugin"
}, {
name: "Tublr",
path: "./tumblr/popcorn.tumblr.unit.html",
type: "Plugin"
}, {
name: "Mustache",
path: "./mustache/popcorn.mustache.unit.html",
type: "Plugin"
}, {
name: "Pause",
path: "./pause/popcorn.pause.unit.html",
type: "Plugin"
}, {
name: "Webpage",
path: "./webpage/popcorn.webpage.unit.html",
type: "Plugin"
}, {
name: "WordRiver",
path: "./wordriver/popcorn.wordriver.unit.html",
type: "Plugin"
}, {
name: "Code",
path: "./code/popcorn.code.unit.html",
type: "Plugin"
}, {
name: "Facebook",
path: "./facebook/popcorn.facebook.unit.html",
type: "Plugin"
}, {
name: "Footnote/Text",
path: "./footnote/popcorn.footnote.unit.html",
type: "Plugin"
}, {
name: "Processing",
path: "./processing/popcorn.processing.unit.html",
type: "Plugin"
}, {
name: "Subtitle",
path: "./subtitle/popcorn.subtitle.unit.html",
type: "Plugin"
}, {
name: "Timeline",
path: "./timeline/popcorn.timeline.unit.html",
type: "Plugin"
}, {
name: "Twitter",
path: "./twitter/popcorn.twitter.unit.html",
type: "Plugin"
}, {
name: "Wikipedia",
path: "./wikipedia/popcorn.wikipedia.unit.html",
type: "Plugin"
}, {
name: "GoogleFeed",
path: "./googlefeed/popcorn.googlefeed.unit.html",
type: "Plugin"
}, {
name: "Image",
path: "./image/popcorn.image.unit.html",
type: "Plugin"
}, {
name: "LastFM",
path: "./lastfm/popcorn.lastfm.unit.html",
type: "Plugin"
}, {
name: "LowerThird",
path: "./lowerthird/popcorn.lowerthird.unit.html",
type: "Plugin"
}, {
name: "OpenMap",
path: "./openmap/popcorn.openmap.unit.html",
type: "Plugin"
}
];

Просмотреть файл

@ -1,6 +1,6 @@
var tests = [{
name: "Core",
path: "./popcorn.unit.html",
path: "./index.html",
type: "Core"
}, {
name: "Attribution",