зеркало из 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.width = "100%";
|
||||||
container.height = "100%";
|
container.height = "100%";
|
||||||
|
|
||||||
container.addEventListener( "load", function( e ) {
|
options.loadListener = function( e ) {
|
||||||
options.widget = widget = SC.Widget( container.id );
|
options.widget = widget = SC.Widget( container.id );
|
||||||
// setup all of our listeners
|
// setup all of our listeners
|
||||||
widget.bind(SC.Widget.Events.FINISH, function() {
|
widget.bind(SC.Widget.Events.FINISH, function() {
|
||||||
|
@ -158,7 +158,9 @@
|
||||||
lastVolume = data / 100;
|
lastVolume = data / 100;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, false);
|
};
|
||||||
|
|
||||||
|
container.addEventListener( "load", options.loadListener, false );
|
||||||
media.appendChild( container );
|
media.appendChild( container );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -199,6 +201,12 @@
|
||||||
|
|
||||||
options.destroyed = true;
|
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
|
// remove all bound soundcloud listeners
|
||||||
for ( var prop in events ) {
|
for ( var prop in events ) {
|
||||||
widget.unbind( events[ prop ] );
|
widget.unbind( events[ prop ] );
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module( "Popcorn Soundcloud Player" );
|
module( "Popcorn Soundcloud Player" );
|
||||||
asyncTest( "Default Attribute Functionality", function () {
|
asyncTest( "Default Attribute Functionality", function () {
|
||||||
var expects = 4,
|
var expects = 5,
|
||||||
count = 0,
|
count = 0,
|
||||||
playerDefault,
|
playerDefault,
|
||||||
playerOverride,
|
playerOverride,
|
||||||
|
@ -41,6 +41,11 @@ asyncTest( "Default Attribute Functionality", function () {
|
||||||
plus();
|
plus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
playerOverride.on( "load", function() {
|
||||||
|
equal( playerOverride.duration(), 217.16, "Duration updated" );
|
||||||
|
plus();
|
||||||
|
});
|
||||||
|
|
||||||
Popcorn.forEach( members, function( val, prop ) {
|
Popcorn.forEach( members, function( val, prop ) {
|
||||||
var actual = playerDefault[prop];
|
var actual = playerDefault[prop];
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче