diff --git a/plugins/code/popcorn.code.unit.js b/plugins/code/popcorn.code.unit.js index 97ebe3c3..70ebcc38 100755 --- a/plugins/code/popcorn.code.unit.js +++ b/plugins/code/popcorn.code.unit.js @@ -1,10 +1,11 @@ test( "Popcorn Code Plugin", function() { var popped = Popcorn( "#video" ), - expects = 9, + expects = 12, count = 0, frames = 0, - codeDiv = document.getElementById( "code-div" ); + codeDiv = document.getElementById( "code-div" ), + hasCheckedFrame = false; expect( expects ); @@ -22,6 +23,19 @@ test( "Popcorn Code Plugin", function() { equal( codeDiv.innerHTML, "", "initially, there is nothing inside the code-div" ); plus(); + popped.code({ + start: 0, + end: 2, + onStart: function( options ) { + ok( this instanceof Popcorn, "this instanceof Popcorn, onStart" ); + plus(); + }, + onEnd: function( options ) { + ok( this instanceof Popcorn, "this instanceof Popcorn, onEnd" ); + plus(); + } + }); + popped.code({ start: 0, end: 2, @@ -56,6 +70,12 @@ test( "Popcorn Code Plugin", function() { plus(); }, onFrame: function ( options ) { + + if ( !hasCheckedFrame ) { + hasCheckedFrame = true; + ok( this instanceof Popcorn, "this instanceof Popcorn, onFrame" ); + plus(); + } codeDiv.innerHTML += "."; frames++; },