Skip to content

Commit

Permalink
Fixed broken tests caused by a bug in Chrome [#737]
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher De Cairos committed Sep 26, 2011
2 parents 1cec17e + 342d26c commit d2f71c0
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions test/popcorn.unit.js
Expand Up @@ -1918,49 +1918,36 @@ test("timeUpdate add track event while paused", function() {

var $pop = Popcorn( "#video" ),
count = 0,
expects = 3;
expects = 1;

expect( expects );

function plus() {
if ( ++count === expects ) {
Popcorn.removePlugin( "timeUpdateTester" );
start();
}
}

Popcorn.plugin("timeUpdateTester", function() {
stop();

Popcorn.plugin( "timeUpdateTester", function() {
return {
start: function () {
var div = document.createElement("div");
div.id = "timeUpdate-test";

document.body.appendChild(div);
ok( true, "timeupdater ran while paused");
plus();
},
end: function () {
document.getElementById("timeUpdate-test").parentNode.removeChild(document.getElementById("timeUpdate-test"));
}
};
});

$pop.currentTime(40).pause();

equals( $pop.getTrackEvents().length, 0, "Initially no trackEvents" );
plus();
$pop.currentTime( 1 ).pause()

$pop.timeUpdateTester({
id:"timeUpdateID",
start:40,
end: 41
start: 1,
end: 2
});

equals( $pop.getTrackEvents().length, 1, "trackEvent successfully added" );
plus();

ok( document.getElementById( "timeUpdate-test" ), "trackEvent successfully added, content was displayed while video was paused" );
plus();

$pop.removeTrackEvent( "timeUpdateID" );

});

test("Plugin Factory", function () {
Expand Down

0 comments on commit d2f71c0

Please sign in to comment.