зеркало из https://github.com/mozilla/popcorn-js.git
Rename Qunit.equals() to Qunit.equal() for non-core tests [#231]
This commit is contained in:
Родитель
4196910fca
Коммит
29e4984eaa
|
@ -241,7 +241,7 @@ test( "Popcorn.smart player selector", function() {
|
||||||
plus();
|
plus();
|
||||||
ok( Popcorn.spartaPlayer.canPlayType( "unsupported element", "this is sparta" ) === false, "canPlayType method fails on invalid container!" );
|
ok( Popcorn.spartaPlayer.canPlayType( "unsupported element", "this is sparta" ) === false, "canPlayType method fails on invalid container!" );
|
||||||
plus();
|
plus();
|
||||||
equals( Popcorn.smart( "#video", "this is sparta" ).media.nodeName, "DIV", "A player was found for this URL" );
|
equal( Popcorn.smart( "#video", "this is sparta" ).media.nodeName, "DIV", "A player was found for this URL" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
// not matching url to player returns false
|
// not matching url to player returns false
|
||||||
|
@ -260,7 +260,7 @@ test( "Popcorn.smart player selector", function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( thisIsNotSparta.media.nodeName, "VIDEO", "no player was found for this URL, default to video element" );
|
equal( thisIsNotSparta.media.nodeName, "VIDEO", "no player was found for this URL, default to video element" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
// no existing canPlayType function returns undefined
|
// no existing canPlayType function returns undefined
|
||||||
|
@ -295,9 +295,9 @@ test( "Popcorn.smart player selector", function() {
|
||||||
}
|
}
|
||||||
}).destroy();
|
}).destroy();
|
||||||
|
|
||||||
equals( loaded, true, "canPlayType passed on a valid type" );
|
equal( loaded, true, "canPlayType passed on a valid type" );
|
||||||
plus();
|
plus();
|
||||||
equals( error, true, "canPlayType failed on an invalid type" );
|
equal( error, true, "canPlayType failed on an invalid type" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -61,17 +61,17 @@
|
||||||
stop();
|
stop();
|
||||||
|
|
||||||
p.exec( 3, function() {
|
p.exec( 3, function() {
|
||||||
equals( startCalled, 5, "start was called 5 times from the parsed data" );
|
equal( startCalled, 5, "start was called 5 times from the parsed data" );
|
||||||
plus();
|
plus();
|
||||||
p.currentTime( 9 );
|
p.currentTime( 9 );
|
||||||
});
|
});
|
||||||
|
|
||||||
p.exec( 10.5, function() {
|
p.exec( 10.5, function() {
|
||||||
equals( endCalled, 5, "end was called 5 times from the parsed data" );
|
equal( endCalled, 5, "end was called 5 times from the parsed data" );
|
||||||
plus()
|
plus()
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( setupCalled, 5, "setup was called 5 times from the parsed data" );
|
equal( setupCalled, 5, "setup was called 5 times from the parsed data" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -33,7 +33,7 @@ test( "Popcorn 0.3 JSON Parser Plugin", function () {
|
||||||
|
|
||||||
Popcorn.forEach( data.json.data, function ( dataObj ) {
|
Popcorn.forEach( data.json.data, function ( dataObj ) {
|
||||||
Popcorn.forEach( dataObj, function ( obj, key ) {
|
Popcorn.forEach( dataObj, function ( obj, key ) {
|
||||||
equals( trackData.history[ idx ].indexOf( key ), 0, "history item '" + trackData.history[ idx ] + "' matches data key '"+ key + "' at correct index" );
|
equal( trackData.history[ idx ].indexOf( key ), 0, "history item '" + trackData.history[ idx ] + "' matches data key '"+ key + "' at correct index" );
|
||||||
plus();
|
plus();
|
||||||
idx++;
|
idx++;
|
||||||
});
|
});
|
||||||
|
@ -45,13 +45,13 @@ test( "Popcorn 0.3 JSON Parser Plugin", function () {
|
||||||
if ( !finished ) {
|
if ( !finished ) {
|
||||||
finished = true;
|
finished = true;
|
||||||
|
|
||||||
equals( trackEvents.byStart.length, numLoadingEvents + 3 , "trackEvents.byStart.length === (5 loaded, 2 padding) " );
|
equal( trackEvents.byStart.length, numLoadingEvents + 3 , "trackEvents.byStart.length === (5 loaded, 2 padding) " );
|
||||||
plus();
|
plus();
|
||||||
equals( $("#video-iframe-container").children().length, 2, '$("#video-iframe-container").children().length' );
|
equal( $("#video-iframe-container").children().length, 2, '$("#video-iframe-container").children().length' );
|
||||||
plus();
|
plus();
|
||||||
equals( $("#video-map-container").children().length, 1, '$("#video-map-container").children().length' );
|
equal( $("#video-map-container").children().length, 1, '$("#video-map-container").children().length' );
|
||||||
plus();
|
plus();
|
||||||
equals( $("#video-footnote-container").children().length, 2, '$("#video-footnote-container").children().length' );
|
equal( $("#video-footnote-container").children().length, 2, '$("#video-footnote-container").children().length' );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
this.pause();
|
this.pause();
|
||||||
|
|
|
@ -36,16 +36,16 @@ test( "Popcorn 0.3 SBV Parser Plugin", function () {
|
||||||
if( evt._natives.type === "subtitle" ) {
|
if( evt._natives.type === "subtitle" ) {
|
||||||
sub = subs[ numSubs++ ];
|
sub = subs[ numSubs++ ];
|
||||||
|
|
||||||
equals( evt.start, sub.start, "Correctly parsed start of " + evt.start );
|
equal( evt.start, sub.start, "Correctly parsed start of " + evt.start );
|
||||||
plus();
|
plus();
|
||||||
equals( evt.text, sub.text, "Correctly parsed text of " + evt.start );
|
equal( evt.text, sub.text, "Correctly parsed text of " + evt.start );
|
||||||
plus();
|
plus();
|
||||||
equals( evt.end, sub.end, "Correctly parsed end at " + evt.start );
|
equal( evt.end, sub.end, "Correctly parsed end at " + evt.start );
|
||||||
plus();
|
plus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( subs.length, numSubs, "Parsed all subtitles" );
|
equal( subs.length, numSubs, "Parsed all subtitles" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -86,21 +86,21 @@ test( "Popcorn 0.3 SRT Parser Plugin", function () {
|
||||||
if( evt._natives.type === "subtitle" ) {
|
if( evt._natives.type === "subtitle" ) {
|
||||||
sub = expectedSubs[ numSubs++ ];
|
sub = expectedSubs[ numSubs++ ];
|
||||||
|
|
||||||
equals( sub.id, evt.id, "Correct id" );
|
equal( sub.id, evt.id, "Correct id" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( sub.start, evt.start, "Correct start" );
|
equal( sub.start, evt.start, "Correct start" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( sub.end, evt.end, "Correct end" );
|
equal( sub.end, evt.end, "Correct end" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( sub.text, evt.text, "Correct text" );
|
equal( sub.text, evt.text, "Correct text" );
|
||||||
plus();
|
plus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( expectedSubs.length, numSubs, "Correctly parsed all subtitles" );
|
equal( expectedSubs.length, numSubs, "Correctly parsed all subtitles" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
|
@ -40,16 +40,16 @@ test( "Popcorn 0.3 SSA/ASS Parser Plugin", function () {
|
||||||
if( evt._natives.type === "subtitle" ) {
|
if( evt._natives.type === "subtitle" ) {
|
||||||
sub = subs[ numSubs++ ];
|
sub = subs[ numSubs++ ];
|
||||||
|
|
||||||
equals( evt.start, sub.start, "Correctly parsed start of " + evt.start );
|
equal( evt.start, sub.start, "Correctly parsed start of " + evt.start );
|
||||||
plus();
|
plus();
|
||||||
equals( evt.text, sub.text, "Correctly parsed text of " + evt.start );
|
equal( evt.text, sub.text, "Correctly parsed text of " + evt.start );
|
||||||
plus();
|
plus();
|
||||||
equals( evt.end, sub.end, "Correctly parsed end at " + evt.start );
|
equal( evt.end, sub.end, "Correctly parsed end at " + evt.start );
|
||||||
plus();
|
plus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( subs.length, numSubs, "Parsed all subtitles" );
|
equal( subs.length, numSubs, "Parsed all subtitles" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
|
@ -42,18 +42,18 @@ test( "Popcorn 0.3 TTXT Parser Plugin", function () {
|
||||||
if( evt._natives.type === "subtitle" ) {
|
if( evt._natives.type === "subtitle" ) {
|
||||||
sub = subs[ numSubs++ ];
|
sub = subs[ numSubs++ ];
|
||||||
|
|
||||||
equals( sub.end, evt.end , "Correct end" );
|
equal( sub.end, evt.end , "Correct end" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( sub.start, evt.start , "Correct start" );
|
equal( sub.start, evt.start , "Correct start" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( sub.text, evt.text , "Correct text" );
|
equal( sub.text, evt.text , "Correct text" );
|
||||||
plus();
|
plus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( subs.length, numSubs , "Correctly parsed all subs" );
|
equal( subs.length, numSubs , "Correctly parsed all subs" );
|
||||||
plus();
|
plus();
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
|
@ -59,7 +59,7 @@ test( "Popcorn 1.0 WebSRT/VTT Parser Plugin", function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( expectedSubs.length, numSubs, "Parsed all subtitles" );
|
equal( expectedSubs.length, numSubs, "Parsed all subtitles" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
|
@ -106,7 +106,7 @@ test( "Default Attribute Functionality", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
playerDefault.addEventListener( "load", function() {
|
playerDefault.addEventListener( "load", function() {
|
||||||
equals( playerDefault.duration, 213.89, "Duration updated" );
|
equal( playerDefault.duration, 213.89, "Duration updated" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -117,20 +117,20 @@ test( "Default Attribute Functionality", function () {
|
||||||
actual = playerDefault[prop]();
|
actual = playerDefault[prop]();
|
||||||
}
|
}
|
||||||
|
|
||||||
equals( actual, val, "player." + prop + " should have default value: '" + val + "'" );
|
equal( actual, val, "player." + prop + " should have default value: '" + val + "'" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( document.getElementById( "player_2" ).children.length, 2, "The container has 2 players" );
|
equal( document.getElementById( "player_2" ).children.length, 2, "The container has 2 players" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( playerDefault.width, playerDefault.offsetWidth+"px", "Width is stringified version of offsetWidth" );
|
equal( playerDefault.width, playerDefault.offsetWidth+"px", "Width is stringified version of offsetWidth" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( playerOverride.width, "90%", "Width has been overridden" );
|
equal( playerOverride.width, "90%", "Width has been overridden" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( playerOverride.height, "81px", "Height has been overridden to 100px, but set back again to 81px" );
|
equal( playerOverride.height, "81px", "Height has been overridden to 100px, but set back again to 81px" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ test( "Player Volume Control", function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
equals( player.volume, targetVolume, "Volume change set correctly" );
|
equal( player.volume, targetVolume, "Volume change set correctly" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
if ( targetVolume !== 0 ) {
|
if ( targetVolume !== 0 ) {
|
||||||
|
@ -243,7 +243,7 @@ test( "Testing Comments", function() {
|
||||||
stop( 5000 );
|
stop( 5000 );
|
||||||
|
|
||||||
Popcorn.forEach( players, function ( player, name ) {
|
Popcorn.forEach( players, function ( player, name ) {
|
||||||
equals( player._comments[0].display(), commentOutput[name](), name + " formatted as expected" );
|
equal( player._comments[0].display(), commentOutput[name](), name + " formatted as expected" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -314,7 +314,7 @@ test( "Events and Player Control", function () {
|
||||||
ok( true, "Playing was fired" );
|
ok( true, "Playing was fired" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( player.paused, 0, "Paused is unset" );
|
equal( player.paused, 0, "Paused is unset" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ test( "Events and Player Control", function () {
|
||||||
ok( true, "ReadyStateChange was fired" );
|
ok( true, "ReadyStateChange was fired" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( player.readyState, 3, "Ready State is now 3" );
|
equal( player.readyState, 3, "Ready State is now 3" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
player.pause();
|
player.pause();
|
||||||
|
@ -352,7 +352,7 @@ test( "Events and Player Control", function () {
|
||||||
ok( true, "Pause was fired by dispatch" );
|
ok( true, "Pause was fired by dispatch" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( player.paused, 1, "Paused is set" );
|
equal( player.paused, 1, "Paused is set" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ test( "Events and Player Control", function () {
|
||||||
ok( true, "Media is done playing" );
|
ok( true, "Media is done playing" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( player.paused, 1, "Paused is set on end" );
|
equal( player.paused, 1, "Paused is set on end" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,7 @@ test( "Plugin Factory", function() {
|
||||||
|
|
||||||
ok( "executor" in popped, "executor plugin is now available to instance" );
|
ok( "executor" in popped, "executor plugin is now available to instance" );
|
||||||
plus();
|
plus();
|
||||||
equals( Popcorn.registry.length, 1, "One item in the registry");
|
equal( Popcorn.registry.length, 1, "One item in the registry");
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.executor({
|
popped.executor({
|
||||||
|
@ -337,7 +337,7 @@ test( "Plugin Factory", function() {
|
||||||
|
|
||||||
ok( "complicator" in popped, "complicator plugin is now available to instance" );
|
ok( "complicator" in popped, "complicator plugin is now available to instance" );
|
||||||
plus();
|
plus();
|
||||||
equals( Popcorn.registry.length, 2, "Two items in the registry");
|
equal( Popcorn.registry.length, 2, "Two items in the registry");
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.complicator({
|
popped.complicator({
|
||||||
|
@ -366,10 +366,10 @@ test( "Popcorn vimeo Plugin Url and Duration Tests", function() {
|
||||||
expect( expects );
|
expect( expects );
|
||||||
stop( 10000 );
|
stop( 10000 );
|
||||||
|
|
||||||
equals( popcorn.media.id, "player_1", "Video id set" );
|
equal( popcorn.media.id, "player_1", "Video id set" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( popcorn.duration(), 0, "Duration starts as 0");
|
equal( popcorn.duration(), 0, "Duration starts as 0");
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popcorn.listen( "durationchange", function() {
|
popcorn.listen( "durationchange", function() {
|
||||||
|
@ -410,7 +410,7 @@ test( "Popcorn vimeo Plugin Url Regex Test", function() {
|
||||||
|
|
||||||
popcorn.listen( "loadeddata", function() {
|
popcorn.listen( "loadeddata", function() {
|
||||||
|
|
||||||
equals( popcorn.media.src, urlTest.expected, "Video id is correct for " + urlTest.name + ": " + urlTest.url );
|
equal( popcorn.media.src, urlTest.expected, "Video id is correct for " + urlTest.name + ": " + urlTest.url );
|
||||||
popcorn.pause();
|
popcorn.pause();
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
|
@ -442,9 +442,9 @@ test( "Popcorn Vimeo Plugin offsetHeight && offsetWidth Test", function() {
|
||||||
|
|
||||||
popped.listen( "loadeddata", function() {
|
popped.listen( "loadeddata", function() {
|
||||||
elem = document.querySelector( "div#player_3 object" );
|
elem = document.querySelector( "div#player_3 object" );
|
||||||
equals( elem.height, popped.media.offsetHeight, "The media object is reporting the correct offsetHeight" );
|
equal( elem.height, popped.media.offsetHeight, "The media object is reporting the correct offsetHeight" );
|
||||||
plus();
|
plus();
|
||||||
equals( elem.width, popped.media.offsetWidth, "The media object is reporting the correct offsetWidth" );
|
equal( elem.width, popped.media.offsetWidth, "The media object is reporting the correct offsetWidth" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,7 @@ test("Plugin Factory", function () {
|
||||||
|
|
||||||
ok( "executor" in popped, "executor plugin is now available to instance" );
|
ok( "executor" in popped, "executor plugin is now available to instance" );
|
||||||
plus();
|
plus();
|
||||||
equals( Popcorn.registry.length, 1, "One item in the registry");
|
equal( Popcorn.registry.length, 1, "One item in the registry");
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.executor({
|
popped.executor({
|
||||||
|
@ -338,7 +338,7 @@ test("Plugin Factory", function () {
|
||||||
|
|
||||||
ok( "complicator" in popped, "complicator plugin is now available to instance" );
|
ok( "complicator" in popped, "complicator plugin is now available to instance" );
|
||||||
plus();
|
plus();
|
||||||
equals( Popcorn.registry.length, 2, "Two items in the registry");
|
equal( Popcorn.registry.length, 2, "Two items in the registry");
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.complicator({
|
popped.complicator({
|
||||||
|
@ -369,7 +369,7 @@ test( "Popcorn YouTube Plugin Url and Duration Tests", function() {
|
||||||
expect( expects );
|
expect( expects );
|
||||||
stop( 10000 );
|
stop( 10000 );
|
||||||
|
|
||||||
equals( popcorn.media.id, 'video2', 'Video id set' );
|
equal( popcorn.media.id, 'video2', 'Video id set' );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popcorn.listen( "durationchange", function() {
|
popcorn.listen( "durationchange", function() {
|
||||||
|
@ -380,7 +380,7 @@ test( "Popcorn YouTube Plugin Url and Duration Tests", function() {
|
||||||
popcorn.pause();
|
popcorn.pause();
|
||||||
});
|
});
|
||||||
|
|
||||||
equals( popcorn.media.id, 'video2', 'Video id set' );
|
equal( popcorn.media.id, 'video2', 'Video id set' );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popcorn.volume( 0 ).play();
|
popcorn.volume( 0 ).play();
|
||||||
|
@ -431,7 +431,7 @@ test( "Popcorn YouTube Plugin Url Regex Test", function() {
|
||||||
|
|
||||||
popcorn.listen( "loadeddata", function() {
|
popcorn.listen( "loadeddata", function() {
|
||||||
|
|
||||||
equals( popcorn.media.src, urlTest.expected, "Video id is correct for " + urlTest.name + ": " + urlTest.url );
|
equal( popcorn.media.src, urlTest.expected, "Video id is correct for " + urlTest.name + ": " + urlTest.url );
|
||||||
popcorn.pause();
|
popcorn.pause();
|
||||||
|
|
||||||
popcorn.destroy();
|
popcorn.destroy();
|
||||||
|
@ -571,9 +571,9 @@ test( "Popcorn Youtube Plugin offsetHeight && offsetWidth Test", function() {
|
||||||
var runner = function() {
|
var runner = function() {
|
||||||
popped.volume( 0 );
|
popped.volume( 0 );
|
||||||
elem = document.querySelector( "div#video6 object" );
|
elem = document.querySelector( "div#video6 object" );
|
||||||
equals( elem.height, popped.media.offsetHeight, "The media object is reporting the correct offsetHeight" );
|
equal( elem.height, popped.media.offsetHeight, "The media object is reporting the correct offsetHeight" );
|
||||||
plus();
|
plus();
|
||||||
equals( elem.width, popped.media.offsetWidth, "The media object is reporting the correct offsetWidth" );
|
equal( elem.width, popped.media.offsetWidth, "The media object is reporting the correct offsetWidth" );
|
||||||
plus();
|
plus();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ test( "Popcorn attribution Plugin", function() {
|
||||||
ok( "attribution" in popped, "attribution is a method of the popped instance" );
|
ok( "attribution" in popped, "attribution is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( attributiondiv.childElementCount, 0, "initially, there is nothing inside the attributiondiv" );
|
equal( attributiondiv.childElementCount, 0, "initially, there is nothing inside the attributiondiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.attribution({
|
popped.attribution({
|
||||||
|
@ -45,9 +45,9 @@ test( "Popcorn attribution Plugin", function() {
|
||||||
setupId = popped.getLastTrackEventId();
|
setupId = popped.getLastTrackEventId();
|
||||||
|
|
||||||
popped.exec( 0, function() {
|
popped.exec( 0, function() {
|
||||||
equals( attributiondiv.childElementCount, 2, "attributiondiv now has two inner elements" );
|
equal( attributiondiv.childElementCount, 2, "attributiondiv now has two inner elements" );
|
||||||
plus();
|
plus();
|
||||||
equals( attributiondiv.children[ 0 ].style.display , "inline", "attribution is visible on the page" );
|
equal( attributiondiv.children[ 0 ].style.display , "inline", "attribution is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -56,17 +56,17 @@ test( "Popcorn attribution Plugin", function() {
|
||||||
ok( /target="_blank"/.test( attributiondiv.innerHTML ), "attributions create anchors that target=_blank" );
|
ok( /target="_blank"/.test( attributiondiv.innerHTML ), "attributions create anchors that target=_blank" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( attributiondiv.children[ 1 ].style.display, "inline", "second attribution is visible on the page" );
|
equal( attributiondiv.children[ 1 ].style.display, "inline", "second attribution is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( typeof popped.data.trackEvents.byStart[ 1 ]._license, "undefined", "undefined license is properly being handled" );
|
equal( typeof popped.data.trackEvents.byStart[ 1 ]._license, "undefined", "undefined license is properly being handled" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 4, function() {
|
popped.exec( 4, function() {
|
||||||
equals( attributiondiv.children[ 1 ].style.display, "none", "second attribution is no longer visible on the page" );
|
equal( attributiondiv.children[ 1 ].style.display, "none", "second attribution is no longer visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( attributiondiv.children[ 0 ].style.display, "none", "first attribution is no longer visible on the page" );
|
equal( attributiondiv.children[ 0 ].style.display, "none", "first attribution is no longer visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.pause().removeTrackEvent( setupId );
|
popped.pause().removeTrackEvent( setupId );
|
||||||
|
|
|
@ -19,7 +19,7 @@ test( "Popcorn Code Plugin", function() {
|
||||||
ok( "code" in popped, "code is a method of the popped instance" );
|
ok( "code" in popped, "code is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( codeDiv.innerHTML, "", "initially, there is nothing inside the code-div" );
|
equal( codeDiv.innerHTML, "", "initially, there is nothing inside the code-div" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.code({
|
popped.code({
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
stop();
|
stop();
|
||||||
ok( "documentcloud" in popped, "documentcloud is a method of the popped instance" );
|
ok( "documentcloud" in popped, "documentcloud is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
equals( cloudDiv1.childElementCount, 0, " #cloud-div-1 is initially empty" );
|
equal( cloudDiv1.childElementCount, 0, " #cloud-div-1 is initially empty" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.documentcloud({
|
popped.documentcloud({
|
||||||
|
@ -63,32 +63,32 @@
|
||||||
if ( ++docCount === 2 ) {
|
if ( ++docCount === 2 ) {
|
||||||
wrapper1 = cloudDiv1.querySelector( "div" );
|
wrapper1 = cloudDiv1.querySelector( "div" );
|
||||||
wrapper2 = cloudDiv2.querySelector( "div" );
|
wrapper2 = cloudDiv2.querySelector( "div" );
|
||||||
equals( cloudDiv1.childElementCount > 0, true, "wrapper div is present in cloud-div-1" );
|
equal( cloudDiv1.childElementCount > 0, true, "wrapper div is present in cloud-div-1" );
|
||||||
plus();
|
plus();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.cue( 3, function() {
|
.cue( 3, function() {
|
||||||
equals( wrapper1.style.visibility, "visible", "Document in cloud-div-1 div is visible" );
|
equal( wrapper1.style.visibility, "visible", "Document in cloud-div-1 div is visible" );
|
||||||
plus();
|
plus();
|
||||||
equals( wrapper2.style.visibility, "hidden", "Document in cloud-div-2 div is visible" );
|
equal( wrapper2.style.visibility, "hidden", "Document in cloud-div-2 div is visible" );
|
||||||
plus();
|
plus();
|
||||||
})
|
})
|
||||||
.cue( 4.5, function() {
|
.cue( 4.5, function() {
|
||||||
equals( wrapper1.style.visibility, "hidden", "Document in cloud-div-1 div is not visible" );
|
equal( wrapper1.style.visibility, "hidden", "Document in cloud-div-1 div is not visible" );
|
||||||
plus();
|
plus();
|
||||||
})
|
})
|
||||||
.cue( 7, function() {
|
.cue( 7, function() {
|
||||||
equals( wrapper1.style.visibility, "visible", "Document in cloud-div-1 div is visible" );
|
equal( wrapper1.style.visibility, "visible", "Document in cloud-div-1 div is visible" );
|
||||||
plus();
|
plus();
|
||||||
equals( wrapper2.style.visibility, "visible", "Document in cloud-div-2 is visible" );
|
equal( wrapper2.style.visibility, "visible", "Document in cloud-div-2 is visible" );
|
||||||
plus();
|
plus();
|
||||||
})
|
})
|
||||||
.cue( 8, function() {
|
.cue( 8, function() {
|
||||||
popped.removeTrackEvent( setupIds.pop() );
|
popped.removeTrackEvent( setupIds.pop() );
|
||||||
equals( cloudDiv1.childElementCount > 0, true, "wrapper div is still present in cloud-div-1" );
|
equal( cloudDiv1.childElementCount > 0, true, "wrapper div is still present in cloud-div-1" );
|
||||||
plus();
|
plus();
|
||||||
popped.removeTrackEvent( setupIds.pop() );
|
popped.removeTrackEvent( setupIds.pop() );
|
||||||
equals( cloudDiv1.childElementCount === 0, true, "wrapper div is no longer present in cloud-div-1" );
|
equal( cloudDiv1.childElementCount === 0, true, "wrapper div is no longer present in cloud-div-1" );
|
||||||
plus();
|
plus();
|
||||||
})
|
})
|
||||||
.listen( "canplayall", function() {
|
.listen( "canplayall", function() {
|
||||||
|
|
|
@ -88,17 +88,17 @@ test( "Popcorn Facebook Plugin", function () {
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.exec( 1, function() {
|
popped.exec( 1, function() {
|
||||||
equals( commentdiv.children[ 0 ].style.display, "none", "comment div is not visible on page with \"none\" display style" );
|
equal( commentdiv.children[ 0 ].style.display, "none", "comment div is not visible on page with \"none\" display style" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
// I inspected the html genterated by facebook, and found that there are no uniquely identifying attributes between plug-in types
|
// I inspected the html genterated by facebook, and found that there are no uniquely identifying attributes between plug-in types
|
||||||
// so right now, we just check ot make sure that facebook is returning a plugin and displaying it at the correct time.
|
// so right now, we just check ot make sure that facebook is returning a plugin and displaying it at the correct time.
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
// Counts number of children elements in likediv
|
// Counts number of children elements in likediv
|
||||||
equals( likediv.childElementCount, 2, "likediv has 2 inner elements" );
|
equal( likediv.childElementCount, 2, "likediv has 2 inner elements" );
|
||||||
plus();
|
plus();
|
||||||
// Checks display style is set correctly on startup
|
// Checks display style is set correctly on startup
|
||||||
equals( likediv.children[ 0 ].style.display , "", "likediv is visible on the page with \"\" display style" );
|
equal( likediv.children[ 0 ].style.display , "", "likediv is visible on the page with \"\" display style" );
|
||||||
plus();
|
plus();
|
||||||
// Checks if likediv is empty at specific time
|
// Checks if likediv is empty at specific time
|
||||||
ok( document.getElementById( "likediv" ).innerHTML, "likediv is not empty at 0:03 (expected)" );
|
ok( document.getElementById( "likediv" ).innerHTML, "likediv is not empty at 0:03 (expected)" );
|
||||||
|
|
|
@ -19,7 +19,7 @@ test( "Popcorn Flickr Plugin", function() {
|
||||||
ok( "flickr" in popped, "flickr is a method of the popped instance" );
|
ok( "flickr" in popped, "flickr is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( flickrdiv.innerHTML, "", "initially, there is nothing inside the flickrdiv" );
|
equal( flickrdiv.innerHTML, "", "initially, there is nothing inside the flickrdiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.flickr({
|
popped.flickr({
|
||||||
|
|
|
@ -19,7 +19,7 @@ test( "Popcorn Footnote Plugin", function() {
|
||||||
ok( "footnote" in popped, "footnote is a mehtod of the popped instance" );
|
ok( "footnote" in popped, "footnote is a mehtod of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( footnotediv.childElementCount, 0, "initially, there is nothing inside the footnotediv" );
|
equal( footnotediv.childElementCount, 0, "initially, there is nothing inside the footnotediv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.footnote({
|
popped.footnote({
|
||||||
|
@ -38,16 +38,16 @@ test( "Popcorn Footnote Plugin", function() {
|
||||||
setupId = popped.getLastTrackEventId();
|
setupId = popped.getLastTrackEventId();
|
||||||
|
|
||||||
popped.exec( 0, function() {
|
popped.exec( 0, function() {
|
||||||
equals( footnotediv.childElementCount, 2, "footnotediv now has two inner elements" );
|
equal( footnotediv.childElementCount, 2, "footnotediv now has two inner elements" );
|
||||||
plus();
|
plus();
|
||||||
equals( footnotediv.children[ 0 ].innerHTML, "This video made exclusively for drumbeat.org", "footnote displaing correct information" );
|
equal( footnotediv.children[ 0 ].innerHTML, "This video made exclusively for drumbeat.org", "footnote displaing correct information" );
|
||||||
plus();
|
plus();
|
||||||
equals( footnotediv.children[ 0 ].style.display, "inline", "footnote is visible on the page" );
|
equal( footnotediv.children[ 0 ].style.display, "inline", "footnote is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
equals( footnotediv.children[ 1 ].style.display, "inline", "second footnote is visible on the page" );
|
equal( footnotediv.children[ 1 ].style.display, "inline", "second footnote is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ test( "Popcorn GML Plugin", function() {
|
||||||
ok( "gml" in popped, "gml is a method of the popped instance" );
|
ok( "gml" in popped, "gml is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( gmldiv.childElementCount, 0, "initially, there is nothing inside the gmldiv" );
|
equal( gmldiv.childElementCount, 0, "initially, there is nothing inside the gmldiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.gml({
|
popped.gml({
|
||||||
|
@ -38,19 +38,19 @@ test( "Popcorn GML Plugin", function() {
|
||||||
setupId = popped.getLastTrackEventId();
|
setupId = popped.getLastTrackEventId();
|
||||||
|
|
||||||
popped.exec( 0, function() {
|
popped.exec( 0, function() {
|
||||||
equals( gmldiv.children[ 0 ].style.display , "block", "first GML is visible on the page" );
|
equal( gmldiv.children[ 0 ].style.display , "block", "first GML is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
equals( gmldiv.children[ 1 ].style.display, "block", "second GML is visible on the page" );
|
equal( gmldiv.children[ 1 ].style.display, "block", "second GML is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 4, function() {
|
popped.exec( 4, function() {
|
||||||
equals( gmldiv.children[ 1 ].style.display, "none", "second GML is no longer visible on the page" );
|
equal( gmldiv.children[ 1 ].style.display, "none", "second GML is no longer visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( gmldiv.children[ 0 ].style.display, "none", "first GML is no longer visible on the page" );
|
equal( gmldiv.children[ 0 ].style.display, "none", "first GML is no longer visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.pause().removeTrackEvent( setupId );
|
popped.pause().removeTrackEvent( setupId );
|
||||||
|
|
|
@ -48,15 +48,15 @@ test( "Popcorn Google Feed Plugin", function() {
|
||||||
plus();
|
plus();
|
||||||
ok( document.getElementById( "_feed1" ), "First feed is on the page" );
|
ok( document.getElementById( "_feed1" ), "First feed is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals ( document.getElementById( "_feed1" ).offsetParent.id, "feed", "First feed is inside the 'feed' div" );
|
equal( document.getElementById( "_feed1" ).offsetParent.id, "feed", "First feed is inside the 'feed' div" );
|
||||||
plus();
|
plus();
|
||||||
equals( popped.data.trackEvents.byStart[ 1 ].orientation, "vertical", "Defaulting to vertical orientation" );
|
equal( popped.data.trackEvents.byStart[ 1 ].orientation, "vertical", "Defaulting to vertical orientation" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
popped.exec( 2, function() {
|
popped.exec( 2, function() {
|
||||||
ok( document.getElementById( "_feed2" ), "Second feed is on the page" );
|
ok( document.getElementById( "_feed2" ), "Second feed is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById( "_feed2" ).offsetParent.id, "feed1", "Second feed is inside the 'feed2' div" );
|
equal( document.getElementById( "_feed2" ).offsetParent.id, "feed1", "Second feed is inside the 'feed2' div" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
|
|
|
@ -66,21 +66,21 @@ test( "Popcorn Google Map Plugin", function() {
|
||||||
plus();
|
plus();
|
||||||
ok( document.getElementById( "actualmap1" ), "First map is on the page" );
|
ok( document.getElementById( "actualmap1" ), "First map is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById( "actualmap1" ).offsetParent.id, "map", "First map is inside the 'map' div" );
|
equal( document.getElementById( "actualmap1" ).offsetParent.id, "map", "First map is inside the 'map' div" );
|
||||||
plus();
|
plus();
|
||||||
equals( popped.data.trackEvents.byStart[ 1 ].zoom, 8, "Defaulting to zoom of 8" );
|
equal( popped.data.trackEvents.byStart[ 1 ].zoom, 8, "Defaulting to zoom of 8" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 1, function() {
|
popped.exec( 1, function() {
|
||||||
ok( document.getElementById( "actualmap2" ), "Second map is on the page" );
|
ok( document.getElementById( "actualmap2" ), "Second map is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById( "actualmap2" ).offsetParent.id, "map2", "Second map is inside the 'map2' div" );
|
equal( document.getElementById( "actualmap2" ).offsetParent.id, "map2", "Second map is inside the 'map2' div" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
equals( document.getElementById( "actualmap3" ).offsetParent.id, "map3", "Tweening map is inside the 'map3' div" );
|
equal( document.getElementById( "actualmap3" ).offsetParent.id, "map3", "Tweening map is inside the 'map3' div" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ test( "Popcorn Image Plugin", function() {
|
||||||
ok( "image" in popped, "image is a method of the popped instance" );
|
ok( "image" in popped, "image is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( imagediv.innerHTML, "", "initially, there is nothing inside the imagediv" );
|
equal( imagediv.innerHTML, "", "initially, there is nothing inside the imagediv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.image({
|
popped.image({
|
||||||
|
@ -51,14 +51,14 @@ test( "Popcorn Image Plugin", function() {
|
||||||
setupId = popped.getLastTrackEventId();
|
setupId = popped.getLastTrackEventId();
|
||||||
|
|
||||||
popped.exec( 2, function() {
|
popped.exec( 2, function() {
|
||||||
equals( imagediv.children[ 0 ].style.display, "block", "Div contents are displayed" );
|
equal( imagediv.children[ 0 ].style.display, "block", "Div contents are displayed" );
|
||||||
plus();
|
plus();
|
||||||
equals( imagediv.children[ 0 ].children[ 1 ].nodeName, "IMG", "An image exists" );
|
equal( imagediv.children[ 0 ].children[ 1 ].nodeName, "IMG", "An image exists" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
equals( imagediv.children[ 0 ].style.display, "none", "Div contents are hidden again" );
|
equal( imagediv.children[ 0 ].style.display, "none", "Div contents are hidden again" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ test( "Popcorn LastFM Plugin", function() {
|
||||||
ok( "lastfm" in popped, "lastfm is a method of the popped instance" );
|
ok( "lastfm" in popped, "lastfm is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( lastfmdiv.innerHTML, "", "initially, there is nothing inside the lastfmdiv" );
|
equal( lastfmdiv.innerHTML, "", "initially, there is nothing inside the lastfmdiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.lastfm({
|
popped.lastfm({
|
||||||
|
@ -51,23 +51,23 @@ test( "Popcorn LastFM Plugin", function() {
|
||||||
setupId = popped.getLastTrackEventId();
|
setupId = popped.getLastTrackEventId();
|
||||||
|
|
||||||
popped.exec( 2, function() {
|
popped.exec( 2, function() {
|
||||||
equals( lastfmdiv.childElementCount, 3, "lastfmdiv now has three inner elements" );
|
equal( lastfmdiv.childElementCount, 3, "lastfmdiv now has three inner elements" );
|
||||||
plus();
|
plus();
|
||||||
equals( lastfmdiv.children[ 0 ].style.display , "inline", "yachtdiv is visible on the page" );
|
equal( lastfmdiv.children[ 0 ].style.display , "inline", "yachtdiv is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
equals( lastfmdiv.children[ 0 ].style.display , "inline", "yachtdiv is still visible on the page" );
|
equal( lastfmdiv.children[ 0 ].style.display , "inline", "yachtdiv is still visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( lastfmdiv.children[ 1 ].style.display , "inline", "beatlesdiv is visible on the page" );
|
equal( lastfmdiv.children[ 1 ].style.display , "inline", "beatlesdiv is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( lastfmdiv.children[ 2 ].style.display , "none", "nulldiv is not visible on the page" );
|
equal( lastfmdiv.children[ 2 ].style.display , "none", "nulldiv is not visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 5, function() {
|
popped.exec( 5, function() {
|
||||||
equals( lastfmdiv.children[ 2 ].innerHTML , "Unknown Artist", "Artist information could not be found" );
|
equal( lastfmdiv.children[ 2 ].innerHTML , "Unknown Artist", "Artist information could not be found" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.pause().removeTrackEvent( setupId );
|
popped.pause().removeTrackEvent( setupId );
|
||||||
|
|
|
@ -28,7 +28,7 @@ test( "Popcorn LinkedIn Plugin", function() {
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
// Testing the share plugin
|
// Testing the share plugin
|
||||||
equals( sharediv.innerHTML, "", "initially, there is nothing inside the sharediv" );
|
equal( sharediv.innerHTML, "", "initially, there is nothing inside the sharediv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.linkedin({
|
popped.linkedin({
|
||||||
|
@ -56,7 +56,7 @@ test( "Popcorn LinkedIn Plugin", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Testing the recommendproduct plugin
|
// Testing the recommendproduct plugin
|
||||||
equals( recommenddiv.innerHTML, "", "initially, there is nothing inside the recommenddiv" );
|
equal( recommenddiv.innerHTML, "", "initially, there is nothing inside the recommenddiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.linkedin({
|
popped.linkedin({
|
||||||
|
@ -85,7 +85,7 @@ test( "Popcorn LinkedIn Plugin", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Testing memberprofile plugin
|
// Testing memberprofile plugin
|
||||||
equals( memberprofilediv.innerHTML, "", "initially, there is nothing inside the memberprofilediv" );
|
equal( memberprofilediv.innerHTML, "", "initially, there is nothing inside the memberprofilediv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.linkedin({
|
popped.linkedin({
|
||||||
|
@ -113,7 +113,7 @@ test( "Popcorn LinkedIn Plugin", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Testing the company insider plugin
|
// Testing the company insider plugin
|
||||||
equals( companyinsiderdiv.innerHTML, "", "initially, there is nothing inside the companyinsiderdiv" );
|
equal( companyinsiderdiv.innerHTML, "", "initially, there is nothing inside the companyinsiderdiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.linkedin({
|
popped.linkedin({
|
||||||
|
@ -140,7 +140,7 @@ test( "Popcorn LinkedIn Plugin", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Testing company profile plugin
|
// Testing company profile plugin
|
||||||
equals( companyprofilediv.innerHTML, "", "initially, there is nothing inside the companyprofilediv" );
|
equal( companyprofilediv.innerHTML, "", "initially, there is nothing inside the companyprofilediv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.linkedin({
|
popped.linkedin({
|
||||||
|
|
|
@ -18,7 +18,7 @@ test( "Popcorn lower third Plugin", function() {
|
||||||
ok( "lowerthird" in popped, "lowerthird is a method of the popped instance" );
|
ok( "lowerthird" in popped, "lowerthird is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals ( lowerthirddiv.innerHTML, "", "initially, there is nothing inside the lowerthirddiv" );
|
equal( lowerthirddiv.innerHTML, "", "initially, there is nothing inside the lowerthirddiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
ok( !popped.container, "initially, there is no default div" );
|
ok( !popped.container, "initially, there is no default div" );
|
||||||
|
@ -56,19 +56,19 @@ test( "Popcorn lower third Plugin", function() {
|
||||||
.volume( 0 );
|
.volume( 0 );
|
||||||
|
|
||||||
popped.exec( 1, function() {
|
popped.exec( 1, function() {
|
||||||
equals( popped.container.innerHTML, "Mr Hyde<br>Monster", "first lowerthird is visible" );
|
equal( popped.container.innerHTML, "Mr Hyde<br>Monster", "first lowerthird is visible" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
equals( lowerthirddiv.innerHTML, "<div>Dr Jekyll<br>Person</div>", "second lowerthird is visible" );
|
equal( lowerthirddiv.innerHTML, "<div>Dr Jekyll<br>Person</div>", "second lowerthird is visible" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 5, function() {
|
popped.exec( 5, function() {
|
||||||
equals( popped.container.innerHTML, "", "first lowerthird is empty" );
|
equal( popped.container.innerHTML, "", "first lowerthird is empty" );
|
||||||
plus();
|
plus();
|
||||||
equals( lowerthirddiv.innerHTML, "<div></div>", "second lowerthird is empty" );
|
equal( lowerthirddiv.innerHTML, "<div></div>", "second lowerthird is empty" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ test( "Popcorn Mustache Plugin", function() {
|
||||||
ok( "mustache" in popped, "mustache is a method of the popped instance" );
|
ok( "mustache" in popped, "mustache is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals ( mustacheDiv.innerHTML, "", "initially, there is nothing inside the mustache-div" );
|
equal( mustacheDiv.innerHTML, "", "initially, there is nothing inside the mustache-div" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
// Static strings
|
// Static strings
|
||||||
|
@ -53,7 +53,7 @@ test( "Popcorn Mustache Plugin", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function runTest( a, b ) {
|
function runTest( a, b ) {
|
||||||
equals( mustacheDiv.innerHTML, "<h1>mustache - test " + a + "/3<\/h1>", "Mustache template rendered" );
|
equal( mustacheDiv.innerHTML, "<h1>mustache - test " + a + "/3<\/h1>", "Mustache template rendered" );
|
||||||
plus();
|
plus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,24 +73,24 @@ test( "Popcorn OpenMap Plugin", function() {
|
||||||
ok( document.getElementById( "openmapdiv1" ), "First map is on the page" );
|
ok( document.getElementById( "openmapdiv1" ), "First map is on the page" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( document.getElementById( "openmapdiv1" ).offsetParent.id, "map", "First map is inside the 'map' div" );
|
equal( document.getElementById( "openmapdiv1" ).offsetParent.id, "map", "First map is inside the 'map' div" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
ok( document.getElementById( "openmapdiv2" ), "Second map is on the page" );
|
ok( document.getElementById( "openmapdiv2" ), "Second map is on the page" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( document.getElementById( "openmapdiv2" ).offsetParent.id, "map2", "Second map is inside the 'map2' div" );
|
equal( document.getElementById( "openmapdiv2" ).offsetParent.id, "map2", "Second map is inside the 'map2' div" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
ok( document.getElementById( "openmapdiv3" ), "Third map is on the page" );
|
ok( document.getElementById( "openmapdiv3" ), "Third map is on the page" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( document.getElementById( "openmapdiv3" ).offsetParent.id, "map3", "Third map is inside the 'map3' div" );
|
equal( document.getElementById( "openmapdiv3" ).offsetParent.id, "map3", "Third map is inside the 'map3' div" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
ok( document.getElementById( "openmapdiv4" ), "Fourth map is on the page" );
|
ok( document.getElementById( "openmapdiv4" ), "Fourth map is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById( "openmapdiv4" ).offsetParent.id, "map4", "Fourth map is inside the 'map4' div" );
|
equal( document.getElementById( "openmapdiv4" ).offsetParent.id, "map4", "Fourth map is inside the 'map4' div" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
} )
|
} )
|
||||||
|
|
|
@ -22,16 +22,16 @@ test( "Processing plugin tests", function() {
|
||||||
ok( "processing" in popped, "processing is a method of the popped instance" );
|
ok( "processing" in popped, "processing is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( processingDiv.innerHTML, "", "'processing-div-1' is empty" );
|
equal( processingDiv.innerHTML, "", "'processing-div-1' is empty" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( processingDiv2.innerHTML, "", "'processing-div-2' is empty" );
|
equal( processingDiv2.innerHTML, "", "'processing-div-2' is empty" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( processingDiv3.innerHTML, "", "'processing-div-3' is empty" );
|
equal( processingDiv3.innerHTML, "", "'processing-div-3' is empty" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( processingDiv4.innerHTML, "", "'processing-div-4' is empty" );
|
equal( processingDiv4.innerHTML, "", "'processing-div-4' is empty" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.processing({
|
popped.processing({
|
||||||
|
@ -67,35 +67,35 @@ test( "Processing plugin tests", function() {
|
||||||
trackids.push( popped.getLastTrackEventId() );
|
trackids.push( popped.getLastTrackEventId() );
|
||||||
|
|
||||||
popped.exec( 0.5, function() {
|
popped.exec( 0.5, function() {
|
||||||
equals( processingDiv.children[ 0 ].style.display, "inline", "canvas '" + processingDiv.children[ 0 ].id + "' is displayed" );
|
equal( processingDiv.children[ 0 ].style.display, "inline", "canvas '" + processingDiv.children[ 0 ].id + "' is displayed" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv2.children[ 0 ].style.display, "none", "canvas '" + processingDiv2.children[ 0 ].id + "' is hidden" );
|
equal( processingDiv2.children[ 0 ].style.display, "none", "canvas '" + processingDiv2.children[ 0 ].id + "' is hidden" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv3.children[ 0 ].style.display, "none", "canvas '" + processingDiv3.children[ 0 ].id + "' is hidden" );
|
equal( processingDiv3.children[ 0 ].style.display, "none", "canvas '" + processingDiv3.children[ 0 ].id + "' is hidden" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv4.children[ 0 ].style.display, "none", "canvas '" + processingDiv4.children[ 0 ].id + "' is hidden" );
|
equal( processingDiv4.children[ 0 ].style.display, "none", "canvas '" + processingDiv4.children[ 0 ].id + "' is hidden" );
|
||||||
plus();
|
plus();
|
||||||
//TODO: David Humphrey has written code that allows for listening to events on Processing instances. when
|
//TODO: David Humphrey has written code that allows for listening to events on Processing instances. when
|
||||||
// it lands In the next processing release we'll be able to detect if a processing instance is looping or not.
|
// it lands In the next processing release we'll be able to detect if a processing instance is looping or not.
|
||||||
// this is required in order to test the noPause functionality (automatically)
|
// this is required in order to test the noPause functionality (automatically)
|
||||||
})
|
})
|
||||||
.exec( 1.5, function() {
|
.exec( 1.5, function() {
|
||||||
equals( processingDiv.children[ 0 ].style.display, "none", "canvas '" + processingDiv.children[ 0 ].id + "' is hidden" );
|
equal( processingDiv.children[ 0 ].style.display, "none", "canvas '" + processingDiv.children[ 0 ].id + "' is hidden" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv2.children[ 0 ].style.display, "inline", "canvas '" + processingDiv2.children[ 0 ].id + "' is displayed" );
|
equal( processingDiv2.children[ 0 ].style.display, "inline", "canvas '" + processingDiv2.children[ 0 ].id + "' is displayed" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv3.children[ 0 ].style.display, "none", "canvas '" + processingDiv3.children[ 0 ].id + "' is hidden" );
|
equal( processingDiv3.children[ 0 ].style.display, "none", "canvas '" + processingDiv3.children[ 0 ].id + "' is hidden" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv4.children[ 0 ].style.display, "none", "canvas '" + processingDiv4.children[ 0 ].id + "' is hidden" );
|
equal( processingDiv4.children[ 0 ].style.display, "none", "canvas '" + processingDiv4.children[ 0 ].id + "' is hidden" );
|
||||||
plus();
|
plus();
|
||||||
}).exec( 3.5, function() {
|
}).exec( 3.5, function() {
|
||||||
equals( processingDiv.children[ 0 ].style.display, "none", "canvas '" + processingDiv.children[ 0 ].id + "' is hidden" );
|
equal( processingDiv.children[ 0 ].style.display, "none", "canvas '" + processingDiv.children[ 0 ].id + "' is hidden" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv2.children[ 0 ].style.display, "none", "canvas '" + processingDiv2.children[ 0 ].id + "' is hidden" );
|
equal( processingDiv2.children[ 0 ].style.display, "none", "canvas '" + processingDiv2.children[ 0 ].id + "' is hidden" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv3.children[ 0 ].style.display, "inline", "canvas '" + processingDiv3.children[ 0 ].id + "' is displayed" );
|
equal( processingDiv3.children[ 0 ].style.display, "inline", "canvas '" + processingDiv3.children[ 0 ].id + "' is displayed" );
|
||||||
plus();
|
plus();
|
||||||
equals( processingDiv4.children[ 0 ].style.display, "inline", "canvas '" + processingDiv4.children[ 0 ].id + "' is displayed" );
|
equal( processingDiv4.children[ 0 ].style.display, "inline", "canvas '" + processingDiv4.children[ 0 ].id + "' is displayed" );
|
||||||
plus();
|
plus();
|
||||||
}).exec( 4.5, function() {
|
}).exec( 4.5, function() {
|
||||||
var idx = 5;
|
var idx = 5;
|
||||||
|
@ -111,7 +111,7 @@ test( "Processing plugin tests", function() {
|
||||||
|
|
||||||
//check that four canvases were created
|
//check that four canvases were created
|
||||||
canvases = document.querySelectorAll( "canvas" );
|
canvases = document.querySelectorAll( "canvas" );
|
||||||
equals( canvases.length, 4, "four canvases are present" );
|
equal( canvases.length, 4, "four canvases are present" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
//enable this when ticket #583 lands
|
//enable this when ticket #583 lands
|
||||||
|
@ -125,10 +125,10 @@ test( "Processing plugin tests", function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
equals( idCount, 1, ctx.id + " is a unique canvas id" );
|
equal( idCount, 1, ctx.id + " is a unique canvas id" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( ctx.style.display, "none", ctx.id + " is hidden initially" );
|
equal( ctx.style.display, "none", ctx.id + " is hidden initially" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ test( "Popcorn Rdio Plugin", function() {
|
||||||
ok( "rdio" in popped, "rdio is a method of the popped instance" );
|
ok( "rdio" in popped, "rdio is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( rdiodiv2.innerHTML, "", "initially, there is nothing inside the rdiodiv" );
|
equal( rdiodiv2.innerHTML, "", "initially, there is nothing inside the rdiodiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.rdio({
|
popped.rdio({
|
||||||
|
@ -59,27 +59,27 @@ test( "Popcorn Rdio Plugin", function() {
|
||||||
});
|
});
|
||||||
setupId = popped.getLastTrackEventId();
|
setupId = popped.getLastTrackEventId();
|
||||||
popped.exec( 2, function() {
|
popped.exec( 2, function() {
|
||||||
equals( rdiodiv.childElementCount, 2, "rdiodiv now has two inner elements" );
|
equal( rdiodiv.childElementCount, 2, "rdiodiv now has two inner elements" );
|
||||||
plus();
|
plus();
|
||||||
equals( rdiodiv.children[ 0 ].style.display , "inline", "Erykah Badu div is visible on the page" );
|
equal( rdiodiv.children[ 0 ].style.display , "inline", "Erykah Badu div is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
equals( rdiodiv.children[ 0 ].style.display , "inline", "Erykah Badu div is still visible on the page" );
|
equal( rdiodiv.children[ 0 ].style.display , "inline", "Erykah Badu div is still visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( rdiodiv.children[ 1 ].style.display , "inline", "Scottyhons div is visible on the page" );
|
equal( rdiodiv.children[ 1 ].style.display , "inline", "Scottyhons div is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( rdiodiv2.children[ 0 ].style.display , "none", "null div is not visible on the page" );
|
equal( rdiodiv2.children[ 0 ].style.display , "none", "null div is not visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( rdiodiv3.children[ 0 ].style.display , "none", "null div is not visible on the page" );
|
equal( rdiodiv3.children[ 0 ].style.display , "none", "null div is not visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 5, function() {
|
popped.exec( 5, function() {
|
||||||
equals( rdiodiv2.children[ 0 ].innerHTML , "Unknown Source", "Artist information could not be found" );
|
equal( rdiodiv2.children[ 0 ].innerHTML , "Unknown Source", "Artist information could not be found" );
|
||||||
plus();
|
plus();
|
||||||
equals( rdiodiv3.children[ 0 ].innerHTML , "Unknown Source", "Playlist information could not be found" );
|
equal( rdiodiv3.children[ 0 ].innerHTML , "Unknown Source", "Playlist information could not be found" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.pause().removeTrackEvent( setupId );
|
popped.pause().removeTrackEvent( setupId );
|
||||||
|
|
|
@ -61,7 +61,7 @@ test( "Popcorn Subtitle Plugin", function() {
|
||||||
popped.exec( 1, function() {
|
popped.exec( 1, function() {
|
||||||
|
|
||||||
popped.media.pause();
|
popped.media.pause();
|
||||||
equals( subtitlediv.children[ 0 ].innerHTML, "this is the first subtitle of 2011", "subtitle displaying correct information" );
|
equal( subtitlediv.children[ 0 ].innerHTML, "this is the first subtitle of 2011", "subtitle displaying correct information" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
// capturing location now, to check against later,
|
// capturing location now, to check against later,
|
||||||
|
@ -93,12 +93,12 @@ test( "Popcorn Subtitle Plugin", function() {
|
||||||
// check values against the video's values
|
// check values against the video's values
|
||||||
// we need four checks because if we just check against video's position,
|
// we need four checks because if we just check against video's position,
|
||||||
// and video's position hasn't updated either, we'll pass when we should fail
|
// and video's position hasn't updated either, we'll pass when we should fail
|
||||||
equals( subtitlediv.style.left, popped.position().left + "px", "subtitle left position moved" );
|
equal( subtitlediv.style.left, popped.position().left + "px", "subtitle left position moved" );
|
||||||
plus();
|
plus();
|
||||||
ok( Popcorn.position( subtitlediv ).top > popped.position().top, "subtitle top position moved" );
|
ok( Popcorn.position( subtitlediv ).top > popped.position().top, "subtitle top position moved" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( subtitlediv.children[ 1 ].innerHTML, "this is the second subtitle of 2011", "subtitle displaying correct information" );
|
equal( subtitlediv.children[ 1 ].innerHTML, "this is the second subtitle of 2011", "subtitle displaying correct information" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.media.play();
|
popped.media.play();
|
||||||
|
@ -108,7 +108,7 @@ test( "Popcorn Subtitle Plugin", function() {
|
||||||
popped.exec( 4, function() {
|
popped.exec( 4, function() {
|
||||||
|
|
||||||
popped.media.pause();
|
popped.media.pause();
|
||||||
equals( subtitlediv.children[ 1 ].innerHTML, "", "subtitle is clear" );
|
equal( subtitlediv.children[ 1 ].innerHTML, "", "subtitle is clear" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.media.play();
|
popped.media.play();
|
||||||
|
@ -123,9 +123,9 @@ test( "Popcorn Subtitle Plugin", function() {
|
||||||
popped2.exec( 8, function() {
|
popped2.exec( 8, function() {
|
||||||
popped2.media.pause();
|
popped2.media.pause();
|
||||||
|
|
||||||
equals( subtitlediv.children[ 3 ].innerHTML, "instance one test", "subtitle displaying correct information" );
|
equal( subtitlediv.children[ 3 ].innerHTML, "instance one test", "subtitle displaying correct information" );
|
||||||
plus();
|
plus();
|
||||||
equals( subtitle2div.children[ 0 ].innerHTML, "instance two test", "subtitle displaying correct information" );
|
equal( subtitle2div.children[ 0 ].innerHTML, "instance two test", "subtitle displaying correct information" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.media.play();
|
popped.media.play();
|
||||||
|
@ -169,7 +169,7 @@ test( "subtitle data tests", function() {
|
||||||
|
|
||||||
popped.pause( 0 );
|
popped.pause( 0 );
|
||||||
|
|
||||||
equals( container.children[ 0 ].innerHTML, "", "subtitle with no text defaults to an empty string" );
|
equal( container.children[ 0 ].innerHTML, "", "subtitle with no text defaults to an empty string" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -202,11 +202,11 @@ test( "subtitle container creation tests", function() {
|
||||||
|
|
||||||
containerAfterParse = document.getElementById("divThatDoesntExist");
|
containerAfterParse = document.getElementById("divThatDoesntExist");
|
||||||
|
|
||||||
equals( !!containerAtLoad, false, "Container doesn't exist initially" );
|
equal( !!containerAtLoad, false, "Container doesn't exist initially" );
|
||||||
plus();
|
plus();
|
||||||
equals( !!containerAfterParse, true, "Container exists now" );
|
equal( !!containerAfterParse, true, "Container exists now" );
|
||||||
plus();
|
plus();
|
||||||
equals( containerAfterParse.children[ 0 ].innerHTML, "My Text", "Subtitle displayed in created container" );
|
equal( containerAfterParse.children[ 0 ].innerHTML, "My Text", "Subtitle displayed in created container" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
|
|
|
@ -19,7 +19,7 @@ test( "Popcorn tagthisperson Plugin", function() {
|
||||||
ok( "tagthisperson" in popped, "tagthisperson is a method of the popped instance" );
|
ok( "tagthisperson" in popped, "tagthisperson is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( tagdiv.innerHTML, "", "initially, there is nothing inside the tagdiv" );
|
equal( tagdiv.innerHTML, "", "initially, there is nothing inside the tagdiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.tagthisperson({
|
popped.tagthisperson({
|
||||||
|
@ -52,23 +52,23 @@ test( "Popcorn tagthisperson Plugin", function() {
|
||||||
.volume( 0 );
|
.volume( 0 );
|
||||||
|
|
||||||
popped.exec( 0, function() {
|
popped.exec( 0, function() {
|
||||||
equals( tagdiv.childElementCount, 2, "tagdiv now contains two child elements" );
|
equal( tagdiv.childElementCount, 2, "tagdiv now contains two child elements" );
|
||||||
plus();
|
plus();
|
||||||
equals( tagdiv.textContent.trim() , "Anna Sob" ,"tagdiv shows the first tag" );
|
equal( tagdiv.textContent.trim() , "Anna Sob" ,"tagdiv shows the first tag" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 1, function() {
|
popped.exec( 1, function() {
|
||||||
equals( tagdiv.innerHTML.search( "<a href" ) , 1 ,"second tag in tagdiv has a url" );
|
equal( tagdiv.innerHTML.search( "<a href" ) , 1 ,"second tag in tagdiv has a url" );
|
||||||
plus();
|
plus();
|
||||||
equals( tagdiv2.textContent.trim(), "Mike, Daniel" ,"tagdiv2 shows the first & second tag" );
|
equal( tagdiv2.textContent.trim(), "Mike, Daniel" ,"tagdiv2 shows the first & second tag" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 2, function() {
|
popped.exec( 2, function() {
|
||||||
equals( tagdiv.innerHTML , "" ,"tagdiv is now cleared" );
|
equal( tagdiv.innerHTML , "" ,"tagdiv is now cleared" );
|
||||||
plus();
|
plus();
|
||||||
equals( tagdiv2.innerHTML , "" ,"tagdiv2 is now cleared" );
|
equal( tagdiv2.innerHTML , "" ,"tagdiv2 is now cleared" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,9 @@ test( "Popcorn Timeline Plugin", function() {
|
||||||
|
|
||||||
ok( "timeline" in popped, "timeline is a method of the popped instance" );
|
ok( "timeline" in popped, "timeline is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById( "timeline-up" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-up' feed" );
|
equal( document.getElementById( "timeline-up" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-up' feed" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById( "timeline-down" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-down' feed" );
|
equal( document.getElementById( "timeline-down" ).firstChild, undefined, "initially, there is nothing inside the 'timeline-down' feed" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.timeline({
|
popped.timeline({
|
||||||
|
@ -69,13 +69,13 @@ test( "Popcorn Timeline Plugin", function() {
|
||||||
//up
|
//up
|
||||||
ok( document.getElementById( "timelineDiv1" ), "First timeline is on the page" );
|
ok( document.getElementById( "timelineDiv1" ), "First timeline is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById("timelineDiv1" ).parentNode.parentNode.id, "timeline-up", "First timeline is inside the 'timeline-up' div" );
|
equal( document.getElementById("timelineDiv1" ).parentNode.parentNode.id, "timeline-up", "First timeline is inside the 'timeline-up' div" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
//down
|
//down
|
||||||
ok( document.getElementById( "timelineDiv3" ), "First timeline is on the page" );
|
ok( document.getElementById( "timelineDiv3" ), "First timeline is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById("timelineDiv3" ).parentNode.parentNode.id, "timeline-down", "First Timeline is inside the 'timeline-down' div" );
|
equal( document.getElementById("timelineDiv3" ).parentNode.parentNode.id, "timeline-down", "First Timeline is inside the 'timeline-down' div" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -85,18 +85,18 @@ test( "Popcorn Timeline Plugin", function() {
|
||||||
timelinediv4 = document.getElementById( "timelineDiv4" );
|
timelinediv4 = document.getElementById( "timelineDiv4" );
|
||||||
ok( timelinediv2, "Second timeline is on the page" );
|
ok( timelinediv2, "Second timeline is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( timelinediv2 && timelinediv2.parentNode.parentNode.id, "timeline-up", "Second timelineDiv2 is inside the 'timeline-up' div" );
|
equal( timelinediv2 && timelinediv2.parentNode.parentNode.id, "timeline-up", "Second timelineDiv2 is inside the 'timeline-up' div" );
|
||||||
plus();
|
plus();
|
||||||
equals( timelineUp.firstChild.firstChild.id, "timelineDiv2", "'timelineDiv2' is the first child in 'timeline-up'" );
|
equal( timelineUp.firstChild.firstChild.id, "timelineDiv2", "'timelineDiv2' is the first child in 'timeline-up'" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
//down
|
//down
|
||||||
|
|
||||||
ok( timelinediv4, "Second down timeline is on the page" );
|
ok( timelinediv4, "Second down timeline is on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( timelinediv4.parentNode.parentNode.id, "timeline-down", "timelineDiv4 is inside the 'timeline-down' div" );
|
equal( timelinediv4.parentNode.parentNode.id, "timeline-down", "timelineDiv4 is inside the 'timeline-down' div" );
|
||||||
plus();
|
plus();
|
||||||
equals( timelineDown.firstChild.firstChild.id, "timelineDiv3", "'timelineDiv3' is the first child in 'timeline-down'" );
|
equal( timelineDown.firstChild.firstChild.id, "timelineDiv3", "'timelineDiv3' is the first child in 'timeline-down'" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
popped.exec( 4, function() {
|
popped.exec( 4, function() {
|
||||||
|
@ -122,9 +122,9 @@ test( "Popcorn Timeline Plugin", function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
popped.pause();
|
popped.pause();
|
||||||
equals( document.getElementById( "timeline-up" ).firstChild, null, "removed timeline was properly destroyed" );
|
equal( document.getElementById( "timeline-up" ).firstChild, null, "removed timeline was properly destroyed" );
|
||||||
plus();
|
plus();
|
||||||
equals( document.getElementById( "timeline-down" ).firstChild, null, "removed timeline was properly destroyed" );
|
equal( document.getElementById( "timeline-down" ).firstChild, null, "removed timeline was properly destroyed" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ test( "Popcorn Tumblr Plugin", function () {
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
// Checks display style is set correctly on startup
|
// Checks display style is set correctly on startup
|
||||||
equals( textblogdiv.style.display , "", "textblogdiv is visible on the page with '' display style" );
|
equal( textblogdiv.style.display , "", "textblogdiv is visible on the page with '' display style" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ test( "Popcorn Twitter Plugin", function() {
|
||||||
ok( "twitter" in popped, "twitter is a method of the popped instance" );
|
ok( "twitter" in popped, "twitter is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals ( twitterdiv.innerHTML, "", "initially, there is nothing inside the twitterdiv" );
|
equal( twitterdiv.innerHTML, "", "initially, there is nothing inside the twitterdiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -18,7 +18,7 @@ test( "Popcorn wikipedia Plugin", function() {
|
||||||
ok( "wikipedia" in popped, "wikipedia is a mehtod of the popped instance" );
|
ok( "wikipedia" in popped, "wikipedia is a mehtod of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( theArticle.innerHTML, "", "initially, there is nothing in the wikidiv" );
|
equal( theArticle.innerHTML, "", "initially, there is nothing in the wikidiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.wikipedia({
|
popped.wikipedia({
|
||||||
|
@ -42,37 +42,37 @@ test( "Popcorn wikipedia Plugin", function() {
|
||||||
popped.exec( 2, function() {
|
popped.exec( 2, function() {
|
||||||
notEqual( theArticle.innerHTML, "", "wikidiv now contains information" );
|
notEqual( theArticle.innerHTML, "", "wikidiv now contains information" );
|
||||||
plus();
|
plus();
|
||||||
equals( theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
|
equal( theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
|
||||||
plus();
|
plus();
|
||||||
equals( theArticle.children[ 0 ].innerHTML, "this is an article", "wikidiv has the right title" );
|
equal( theArticle.children[ 0 ].innerHTML, "this is an article", "wikidiv has the right title" );
|
||||||
plus();
|
plus();
|
||||||
notEqual( theArticle.children[ 1 ].innerHTML, "", "wikidiv has some content" );
|
notEqual( theArticle.children[ 1 ].innerHTML, "", "wikidiv has some content" );
|
||||||
plus();
|
plus();
|
||||||
// subtract 1 from length for the '...' added in by the plugin
|
// subtract 1 from length for the '...' added in by the plugin
|
||||||
equals( theArticle.children[ 1 ].innerHTML.split( " " ).length -1, 22, "wikidiv contains 22 words" );
|
equal( theArticle.children[ 1 ].innerHTML.split( " " ).length -1, 22, "wikidiv contains 22 words" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 3, function() {
|
popped.exec( 3, function() {
|
||||||
equals( theArticle.innerHTML, "", "wikidiv was cleared properly" );
|
equal( theArticle.innerHTML, "", "wikidiv was cleared properly" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 4, function() {
|
popped.exec( 4, function() {
|
||||||
notEqual( theArticle.innerHTML, "", "wikidiv now contains information" );
|
notEqual( theArticle.innerHTML, "", "wikidiv now contains information" );
|
||||||
plus();
|
plus();
|
||||||
equals( theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
|
equal( theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
|
||||||
plus();
|
plus();
|
||||||
notEqual( theArticle.children[ 1 ].innerHTML, "", "wikidiv has the right content" );
|
notEqual( theArticle.children[ 1 ].innerHTML, "", "wikidiv has the right content" );
|
||||||
plus();
|
plus();
|
||||||
// subtract 1 from length for the '...' added in by the plugin
|
// subtract 1 from length for the '...' added in by the plugin
|
||||||
equals( theArticle.children[ 1 ].innerHTML.split(" ").length - 1, 43, "wikidiv contains 43 words" );
|
equal( theArticle.children[ 1 ].innerHTML.split(" ").length - 1, 43, "wikidiv contains 43 words" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 6, function() {
|
popped.exec( 6, function() {
|
||||||
popped.pause().removeTrackEvent( popped.data.trackEvents.byStart[ 4 ]._id );
|
popped.pause().removeTrackEvent( popped.data.trackEvents.byStart[ 4 ]._id );
|
||||||
equals( theArticle.innerHTML, "", "wikidiv is now empty" );
|
equal( theArticle.innerHTML, "", "wikidiv is now empty" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ test( "Popcorn wordriver Plugin", function() {
|
||||||
ok( "wordriver" in popped, "wordriver is a method of the popped instance" );
|
ok( "wordriver" in popped, "wordriver is a method of the popped instance" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
equals( wordriverdiv.childElementCount, 0, "initially, there is nothing inside the wordriverdiv" );
|
equal( wordriverdiv.childElementCount, 0, "initially, there is nothing inside the wordriverdiv" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.wordriver({
|
popped.wordriver({
|
||||||
|
@ -53,43 +53,43 @@ test( "Popcorn wordriver Plugin", function() {
|
||||||
.volume( 0 );
|
.volume( 0 );
|
||||||
|
|
||||||
popped.exec( 0, function() {
|
popped.exec( 0, function() {
|
||||||
equals( wordriverdiv.children[ 0 ].childElementCount, 1, "wordriverdiv now has one inner element" );
|
equal( wordriverdiv.children[ 0 ].childElementCount, 1, "wordriverdiv now has one inner element" );
|
||||||
plus();
|
plus();
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 1, "first word is visible on the page" );
|
equal( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 1, "first word is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "hello", "first word content is correct" );
|
equal( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "hello", "first word content is correct" );
|
||||||
plus();
|
plus();
|
||||||
ok( !wordriverdiv.children[ 0 ].children[ 1 ], "second word does not exist yet" );
|
ok( !wordriverdiv.children[ 0 ].children[ 1 ], "second word does not exist yet" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 2, function() {
|
popped.exec( 2, function() {
|
||||||
equals( wordriverdiv.children[ 0 ].childElementCount, 2, "wordriverdiv now has two inner elements" );
|
equal( wordriverdiv.children[ 0 ].childElementCount, 2, "wordriverdiv now has two inner elements" );
|
||||||
plus();
|
plus();
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 0, "first word is not visible on the page" );
|
equal( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 0, "first word is not visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "hello", "first word content is correct" );
|
equal( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "hello", "first word content is correct" );
|
||||||
plus();
|
plus();
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 1 ].style.opacity, 1, "second word is visible on the page" );
|
equal( wordriverdiv.children[ 0 ].children[ 1 ].style.opacity, 1, "second word is visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 1 ].innerHTML, "world", "second word content is correct" );
|
equal( wordriverdiv.children[ 0 ].children[ 1 ].innerHTML, "world", "second word content is correct" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
popped.exec( 4, function() {
|
popped.exec( 4, function() {
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 0, "first word is not visible on the page" );
|
equal( wordriverdiv.children[ 0 ].children[ 0 ].style.opacity, 0, "first word is not visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 1 ].style.opacity, 0, "second word is not visible on the page" );
|
equal( wordriverdiv.children[ 0 ].children[ 1 ].style.opacity, 0, "second word is not visible on the page" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.pause().removeTrackEvent( firstTrack );
|
popped.pause().removeTrackEvent( firstTrack );
|
||||||
equals( wordriverdiv.children[ 0 ].childElementCount, 1, "wordriverdiv now has one inner element" );
|
equal( wordriverdiv.children[ 0 ].childElementCount, 1, "wordriverdiv now has one inner element" );
|
||||||
plus();
|
plus();
|
||||||
equals( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "world", "first word content is changed" );
|
equal( wordriverdiv.children[ 0 ].children[ 0 ].innerHTML, "world", "first word content is changed" );
|
||||||
plus();
|
plus();
|
||||||
|
|
||||||
popped.pause().removeTrackEvent( secondTrack );
|
popped.pause().removeTrackEvent( secondTrack );
|
||||||
equals( wordriverdiv.childElementCount, 0, "wordriverdiv now has no inner element, even though one still exists, but was never called" );
|
equal( wordriverdiv.childElementCount, 0, "wordriverdiv now has no inner element, even though one still exists, but was never called" );
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ var tests = [
|
||||||
test: function() {
|
test: function() {
|
||||||
expect(2);
|
expect(2);
|
||||||
var results = Popcorn.getTrackEvents(popcorn);
|
var results = Popcorn.getTrackEvents(popcorn);
|
||||||
equals(results[0].start, 1, 'start is 1');
|
equal(results[0].start, 1, 'start is 1');
|
||||||
equals(results[0].end, 2, 'end is 2');
|
equal(results[0].end, 2, 'end is 2');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ var tests = [
|
||||||
{
|
{
|
||||||
title: 'p[validPluginName] is expected plugin',
|
title: 'p[validPluginName] is expected plugin',
|
||||||
test: function() {
|
test: function() {
|
||||||
equals(popcorn['test'],plugin['test'], 'popcorn[\'test\'] == plugin[\'test\']');
|
equal(popcorn['test'],plugin['test'], 'popcorn[\'test\'] == plugin[\'test\']');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -72,13 +72,13 @@ var tests = [
|
||||||
test: function() {
|
test: function() {
|
||||||
expect(2);
|
expect(2);
|
||||||
ok(Popcorn.registry, 'registry exists');
|
ok(Popcorn.registry, 'registry exists');
|
||||||
equals(typeof(Popcorn.registry), 'object', 'Popcorn.registry is an object');
|
equal(typeof(Popcorn.registry), 'object', 'Popcorn.registry is an object');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Popcorn.registry must contain plugins',
|
title: 'Popcorn.registry must contain plugins',
|
||||||
test: function() {
|
test: function() {
|
||||||
equals(Popcorn.registry[0], plugin, 'Popcorn.registry contains test plugin');
|
equal(Popcorn.registry[0], plugin, 'Popcorn.registry contains test plugin');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -104,13 +104,13 @@ var tests = [
|
||||||
test: function() {
|
test: function() {
|
||||||
expect(2);
|
expect(2);
|
||||||
ok(Popcorn.manifest, 'Popcorn.manifest exists');
|
ok(Popcorn.manifest, 'Popcorn.manifest exists');
|
||||||
equals(typeof(Popcorn.manifest), 'object', 'Popcorn.manifest is an object');
|
equal(typeof(Popcorn.manifest), 'object', 'Popcorn.manifest is an object');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Popcorn.manifest must contain plugin manifests',
|
title: 'Popcorn.manifest must contain plugin manifests',
|
||||||
test: function() {
|
test: function() {
|
||||||
equals(Popcorn.manifest['test'], manifest);
|
equal(Popcorn.manifest['test'], manifest);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -184,7 +184,7 @@ var tests = [
|
||||||
test: function() {
|
test: function() {
|
||||||
expect(2);
|
expect(2);
|
||||||
ok(popcorn.data.history, 'history exists');
|
ok(popcorn.data.history, 'history exists');
|
||||||
equals(typeof(popcorn.data.history), 'object', 'history in an object');
|
equal(typeof(popcorn.data.history), 'object', 'history in an object');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -209,8 +209,8 @@ var tests = [
|
||||||
expect(2);
|
expect(2);
|
||||||
var tracks1 = popcorn.getTrackEvents();
|
var tracks1 = popcorn.getTrackEvents();
|
||||||
var tracks2 = Popcorn.getTrackEvents(popcorn);
|
var tracks2 = Popcorn.getTrackEvents(popcorn);
|
||||||
equals(tracks1.length, tracks2.length, 'lengths are equal');
|
equal(tracks1.length, tracks2.length, 'lengths are equal');
|
||||||
equals(tracks1[0], tracks2[0], 'objects are equal');
|
equal(tracks1[0], tracks2[0], 'objects are equal');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -231,7 +231,7 @@ var tests = [
|
||||||
expect(2);
|
expect(2);
|
||||||
ok(popcorn.removeTrackEvent, 'exists');
|
ok(popcorn.removeTrackEvent, 'exists');
|
||||||
popcorn.removeTrackEvent(popcorn.getLastTrackEventId());
|
popcorn.removeTrackEvent(popcorn.getLastTrackEventId());
|
||||||
equals(popcorn.getTrackEvents().length, 0, 'works');
|
equal(popcorn.getTrackEvents().length, 0, 'works');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче