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:
David Seifried 2012-05-28 10:07:15 -07:00
Родитель be7853b6bf 1e3c1b27c1
Коммит 137c734ff8
2 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -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];