Fix failing Core test for FX 3.6 [#773]

This commit is contained in:
Christopher De Cairos 2012-03-02 15:38:03 -05:00
Родитель 16bc3e4d0c 095f37c43a
Коммит 9d7396ce15
1 изменённых файлов: 11 добавлений и 8 удалений

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

@ -867,27 +867,30 @@ test( "play(n)/pause(n) as shorthand to currentTime(n).play()/pause()", function
} }
} }
stop( 1000 ); stop( 10000 );
function poll() { function poll() {
if ( $pop.media.readyState >= 2 ) { if ( $pop.media.readyState >= 2 ) {
// this should trigger immediately // this should trigger immediately
var firstSeekedEvent = function() {
// IE9 has weird seek behaviour... this works around it $pop.unlisten( "seeked", firstSeekedEvent );
$pop.listen( "seeked", function() {
$pop.unlisten( "seeked" );
equal( Math.round( $pop.currentTime() ), 10, "play(n) sets currentTime to 10" ); equal( Math.round( $pop.currentTime() ), 10, "play(n) sets currentTime to 10" );
plus(); plus();
$pop.listen( "seeked", secondSeekedEvent );
$pop.pause( 5 ); $pop.pause( 5 );
},
secondSeekedEvent = function() {
$pop.unlisten( "seeked", secondSeekedEvent );
equal( Math.round( $pop.currentTime() ), 5, "pause(n) sets currentTime to 5" ); equal( Math.round( $pop.currentTime() ), 5, "pause(n) sets currentTime to 5" );
plus(); plus();
}); };
$pop.listen( "seeked", firstSeekedEvent );
$pop.play( 10 ).pause(); $pop.play( 10 ).pause();
} else { } else {
setTimeout( poll, 10 ); setTimeout( poll, 10 );
} }