Skip to content

Commit

Permalink
[mozilla#349] Update exec unit tests to reflect Popcorn.events intern…
Browse files Browse the repository at this point in the history
…als change
  • Loading branch information
rwaldron committed Feb 16, 2011
1 parent 160025b commit 0ad5e38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
7 changes: 5 additions & 2 deletions popcorn.js
Expand Up @@ -337,10 +337,13 @@

callback.fired = true;

this.unlisten("timeupdate", guid );

fn.call(self, event);

setTimeout(function() {

callback.fired = false;

}, 500 );
}
};

Expand Down
24 changes: 11 additions & 13 deletions test/popcorn.unit.js
Expand Up @@ -175,7 +175,9 @@ test("exec", function () {

var popped = Popcorn("#video"),
expects = 2,
count = 0;
count = 0,
hasLooped = false,
loop = 0;

expect(expects);

Expand All @@ -184,22 +186,18 @@ test("exec", function () {
}

stop( 10000 );



popped.exec( 4, function () {


ok(true, "exec callback fired");
plus();


equal( popped.data.events.timeupdate, null, "exec callback removed");
ok(true, "exec callback fired " + loop++ );
plus();


if ( !hasLooped ) {

popped.currentTime(3).play();

hasLooped = true;
}
}).currentTime(3).play();



});

Expand Down

0 comments on commit 0ad5e38

Please sign in to comment.