From a0174e9e6ae4e25d549a14be09bb334b8bc6fa39 Mon Sep 17 00:00:00 2001 From: Christopher De Cairos Date: Mon, 31 Oct 2011 11:28:23 -0400 Subject: [PATCH] added tests for triggered events --- players/vimeo/popcorn.vimeo.unit.js | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/players/vimeo/popcorn.vimeo.unit.js b/players/vimeo/popcorn.vimeo.unit.js index 3466cfb4..f894c39a 100644 --- a/players/vimeo/popcorn.vimeo.unit.js +++ b/players/vimeo/popcorn.vimeo.unit.js @@ -3,7 +3,7 @@ test( "Update Timer", function() { QUnit.reset(); var p2 = Popcorn.vimeo( "#player_1", "http://player.vimeo.com/video/6960892" ), - expects = 12, + expects = 16, count = 0, execCount = 0, // These make sure events are only fired once @@ -29,6 +29,30 @@ test( "Update Timer", function() { // These tests come close to 10 seconds on chrome, increasing to 15 stop(); + p2.listen( "canplaythrough", function() { + p2.unlisten( "canplaythrough" ); + ok( true, "'canplaythrough' fired" ); + plus(); + }); + + p2.listen( "load", function() { + p2.unlisten( "load" ); + ok( true, "'load' fired" ); + plus(); + }); + + p2.listen( "durationchange", function() { + p2.unlisten( "durationchange" ); + ok( true, "'durationchange' fired" ); + plus(); + }); + + p2.listen( "loadeddata", function() { + p2.unlisten( "loadeddata" ); + ok( true, "'loadeddata' fired" ); + plus(); + }); + Popcorn.plugin( "forwards", function() { return { start: function( event, options ) { @@ -192,7 +216,7 @@ test( "Plugin Factory", function() { } expect( expects ); - stop( 15000 ); + stop( 20000 ); Popcorn.plugin( "executor", function() {