зеркало из https://github.com/mozilla/popcorn-js.git
[#1016] adding tests for error object
This commit is contained in:
Родитель
08c2e95bce
Коммит
35cdabaa36
|
@ -561,13 +561,14 @@ asyncTest( "Popcorn Youtube Plugin offsetHeight && offsetWidth Test", function()
|
|||
|
||||
asyncTest( "Player Errors", function() {
|
||||
|
||||
expect( 1 );
|
||||
expect( 2 );
|
||||
|
||||
var pop = Popcorn.youtube( "#video4", "http://www.youtube.com/watch?v=abcdefghijk", {
|
||||
events: {
|
||||
error: function() {
|
||||
|
||||
ok( true, "error trigger by invalid URL" );
|
||||
equal( pop.error.customCode, 100, "error.customCode is 100 for invalid URL" );
|
||||
pop.destroy();
|
||||
start();
|
||||
}
|
||||
|
|
|
@ -20,6 +20,21 @@ test( "Core", function() {
|
|||
} catch ( e ) {};
|
||||
});
|
||||
|
||||
asyncTest( "Unsupported video error", function() {
|
||||
|
||||
var unsupported = document.createElement( "video" ),
|
||||
popcorn = Popcorn( unsupported );
|
||||
|
||||
popcorn.on( "error", function() {
|
||||
|
||||
equal( popcorn.error.code, 4, "Unsupported video reports error code 4." );
|
||||
popcorn.destroy();
|
||||
start();
|
||||
});
|
||||
|
||||
unsupported.src = "data:video/x-unsupported,0";
|
||||
});
|
||||
|
||||
test( "noConflict", function() {
|
||||
|
||||
expect( 6 );
|
||||
|
@ -1124,7 +1139,7 @@ test( "Popcorn.extend", function() {
|
|||
test( "Popcorn.events", function() {
|
||||
|
||||
QUnit.reset()
|
||||
expect( 43 );
|
||||
expect( 44 );
|
||||
|
||||
var eventTypes = [ "UIEvents", "MouseEvents", "Events" ],
|
||||
natives = "",
|
||||
|
|
Загрузка…
Ссылка в новой задаче