зеркало из https://github.com/mozilla/popcorn-js.git
Merge pull request #77 from dseif/t621
[#621] Soundcloud player unit tests time out on all Firefox, Safari, and Chrome
This commit is contained in:
Коммит
137c734ff8
|
@ -114,7 +114,7 @@
|
|||
container.width = "100%";
|
||||
container.height = "100%";
|
||||
|
||||
container.addEventListener( "load", function( e ) {
|
||||
options.loadListener = function( e ) {
|
||||
options.widget = widget = SC.Widget( container.id );
|
||||
// setup all of our listeners
|
||||
widget.bind(SC.Widget.Events.FINISH, function() {
|
||||
|
@ -158,7 +158,9 @@
|
|||
lastVolume = data / 100;
|
||||
});
|
||||
});
|
||||
}, false);
|
||||
};
|
||||
|
||||
container.addEventListener( "load", options.loadListener, false );
|
||||
media.appendChild( container );
|
||||
});
|
||||
}
|
||||
|
@ -199,6 +201,12 @@
|
|||
|
||||
options.destroyed = true;
|
||||
|
||||
// if the widget never got setup, remove the containers load listener and return
|
||||
if ( !widget ) {
|
||||
container.removeEventListener( "load", options.loadEventListener, false );
|
||||
return;
|
||||
}
|
||||
|
||||
// remove all bound soundcloud listeners
|
||||
for ( var prop in events ) {
|
||||
widget.unbind( events[ prop ] );
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module( "Popcorn Soundcloud Player" );
|
||||
asyncTest( "Default Attribute Functionality", function () {
|
||||
var expects = 4,
|
||||
var expects = 5,
|
||||
count = 0,
|
||||
playerDefault,
|
||||
playerOverride,
|
||||
|
@ -41,6 +41,11 @@ asyncTest( "Default Attribute Functionality", function () {
|
|||
plus();
|
||||
});
|
||||
|
||||
playerOverride.on( "load", function() {
|
||||
equal( playerOverride.duration(), 217.16, "Duration updated" );
|
||||
plus();
|
||||
});
|
||||
|
||||
Popcorn.forEach( members, function( val, prop ) {
|
||||
var actual = playerDefault[prop];
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче