зеркало из https://github.com/mozilla/popcorn-js.git
[#1023] Review fixes.
This commit is contained in:
Родитель
9febc314ae
Коммит
a9d3d99cf9
|
@ -13,7 +13,8 @@
|
|||
container = document.createElement( "iframe" ),
|
||||
lastVolume = 1,
|
||||
currentTime = 0,
|
||||
paused = realPaused = true,
|
||||
paused = true,
|
||||
realPaused = true,
|
||||
widget,
|
||||
duration = 0,
|
||||
muted = false,
|
||||
|
|
|
@ -438,71 +438,6 @@ asyncTest( "Popcorn YouTube Plugin Url Regex Test", function() {
|
|||
});
|
||||
});
|
||||
|
||||
/*asyncTest( "Controls and Annotations toggling", function() {
|
||||
|
||||
var count = 0,
|
||||
expects = 6,
|
||||
testTarget = "",
|
||||
targetDiv;
|
||||
|
||||
function plus(){
|
||||
if ( ++count == expects ) {
|
||||
start();
|
||||
}
|
||||
}
|
||||
|
||||
expect( expects );
|
||||
|
||||
var popcorn1 = Popcorn.youtube( "#video", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
|
||||
|
||||
popcorn1.listen( "loadeddata", function() {
|
||||
|
||||
targetDiv = document.getElementById( "video" );
|
||||
testTarget = targetDiv.querySelector( "object" ).getAttribute( "data-youtube-player" );
|
||||
|
||||
popcorn1.volume( 0 );
|
||||
|
||||
ok( !/controls/.test( testTarget ), "controls are defaulted to 1 ( displayed )" );
|
||||
plus();
|
||||
ok( !/iv_load_policy/.test( testTarget ), "annotations ( iv_load_policy ) are defaulted to ( enabled )" );
|
||||
plus();
|
||||
|
||||
popcorn1.destroy();
|
||||
|
||||
var popcorn2 = Popcorn.youtube( "#video", "http://www.youtube.com/watch?v=nfGV32RNkhw&controls=1&iv_load_policy=1" );
|
||||
popcorn2.listen( "loadeddata", function() {
|
||||
|
||||
targetDiv = document.getElementById( "video" );
|
||||
testTarget = targetDiv.querySelector( "object" ).getAttribute( "data-youtube-player" );
|
||||
|
||||
popcorn2.volume( 0 );
|
||||
|
||||
ok( /controls=1/.test( testTarget ), "controls is set to 1 ( displayed )" );
|
||||
plus();
|
||||
ok( /iv_load_policy=1/.test( testTarget ), "annotations ( iv_load_policy ) is set to 1 ( enabled )" );
|
||||
plus();
|
||||
|
||||
popcorn2.destroy();
|
||||
|
||||
var popcorn3 = Popcorn.youtube( "#video", "http://www.youtube.com/watch?v=nfGV32RNkhw&controls=0&iv_load_policy=3" );
|
||||
popcorn3.listen( "loadeddata", function() {
|
||||
|
||||
targetDiv = document.getElementById( "video" );
|
||||
testTarget = targetDiv.querySelector( "object" ).getAttribute( "data-youtube-player" );
|
||||
|
||||
popcorn3.volume( 0 );
|
||||
|
||||
ok( /controls=0/.test( testTarget ), "controls is set to 0 ( hidden )" );
|
||||
plus();
|
||||
ok( /iv_load_policy=3/.test( testTarget ), "annotations ( iv_load_policy ) is set to 3 ( hidden )" );
|
||||
plus();
|
||||
|
||||
popcorn3.destroy();
|
||||
});
|
||||
});
|
||||
});
|
||||
});*/
|
||||
|
||||
asyncTest( "Player height and width", function() {
|
||||
|
||||
expect( 4 );
|
||||
|
@ -534,41 +469,6 @@ asyncTest( "Player height and width", function() {
|
|||
readyStatePoll();
|
||||
});
|
||||
|
||||
/*asyncTest( "Popcorn Youtube Plugin offsetHeight && offsetWidth Test", function() {
|
||||
|
||||
var popped,
|
||||
elem,
|
||||
expects = 2,
|
||||
count = 0;
|
||||
|
||||
expect( expects );
|
||||
|
||||
function plus() {
|
||||
if ( ++count === expects ) {
|
||||
|
||||
popped.destroy();
|
||||
start();
|
||||
}
|
||||
}
|
||||
|
||||
popped = Popcorn.youtube( "#video6", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
|
||||
|
||||
var runner = function() {
|
||||
popped.volume( 0 );
|
||||
elem = document.querySelector( "div#video6 object" );
|
||||
equal( elem.height, popped.media.offsetHeight, "The media object is reporting the correct offsetHeight" );
|
||||
plus();
|
||||
equal( elem.width, popped.media.offsetWidth, "The media object is reporting the correct offsetWidth" );
|
||||
plus();
|
||||
};
|
||||
|
||||
if ( popped.readyState >= 2 ) {
|
||||
runner();
|
||||
} else {
|
||||
popped.listen( "loadeddata", runner);
|
||||
}
|
||||
});*/
|
||||
|
||||
asyncTest( "Player Errors", function() {
|
||||
|
||||
expect( 2 );
|
||||
|
|
Загрузка…
Ссылка в новой задаче