From 79ddac36fa13f8154c5fc8411075fe9be8357dd2 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Fri, 10 Dec 2010 16:58:54 -0500 Subject: [PATCH] added failure check for stalling test --- test/popcorn.unit.js | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 3d1c57f..57db619 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -163,7 +163,7 @@ test("Stored By Type", function () { function plus(){ - if ( ++count == 4 ) { + if ( ++count === 4 ) { equals( fired, wants, "Number of callbacks fired from 1 handler" ); @@ -207,6 +207,10 @@ test("Stored By Type", function () { }); p.trigger("play"); + + if (fired < 4) { + start(); + } p.unlisten("play"); @@ -369,7 +373,7 @@ test("Plugin Factory", function () { var popped = Popcorn("#video"), methods = "load play pause currentTime mute volume roundTime exec", - expects = 22, + expects = 24, count = 0; //expect(expects); @@ -459,7 +463,7 @@ test("Plugin Factory", function () { ok( "tracks" in this.data, " complicatorinstance has `tracks` property" ); plus(); - ok( Object.prototype.toString.call(popped.data.tracks) === "[object Array]", "complicator tracks property is an array" ) + ok( Object.prototype.toString.call(popped.data.tracks) === "[object Object]", "complicator tracks property is an object" ) plus(); }, end: function () { @@ -503,7 +507,7 @@ test("Plugin Factory", function () { breaker.end++; - ok(true, "breaker started"); + ok(true, "breaker ended"); plus(); @@ -522,12 +526,30 @@ test("Plugin Factory", function () { end: 2 }); - - popped.currentTime(0).play(); + /*Popcorn.plugin("updater", function () { + + return { + + start: function () { + ok( true, "start correctly called at " + popped.currentTime()); + plus(); + }, + end: function () { + ok( true, "end correctly called"); + plus(); + } + }; + }); - + popped.updater({ + start: 2, + end: 3 + });*/ + + popped.currentTime(0).play(); }); + test("Protected Names", function () { //QUnit.reset(); -- 2.43.0