From 4dedb7ccc516138e472ddc2ec1b739ee8d6a1859 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Thu, 23 Jun 2011 16:00:25 -0400 Subject: [PATCH] [#t596] modified unit tests for chrome --- test/popcorn.unit.js | 49 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index efd738c..6b1192b 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -1275,6 +1275,7 @@ test("Update Timer", function () { var p2 = Popcorn("#video"), expects = 12, count = 0, + execCount = 0, // These make sure events are only fired once // any second call will produce a failed test forwardStart = false, @@ -1385,34 +1386,50 @@ test("Update Timer", function () { // checking wrapper 2's start .exec( 5, function() { - ok( wrapperRunning.two, "wrapper two is running at second 5" ); - plus(); - ok( !wrapperRunning.one, "wrapper one is stopped at second 5" ); - plus(); + if ( execCount === 0 ) { + + execCount++; + ok( wrapperRunning.two, "wrapper two is running at second 5" ); + plus(); + ok( !wrapperRunning.one, "wrapper one is stopped at second 5" ); + plus(); + } }) // checking wrapper 1's start .exec( 6, function() { - ok( wrapperRunning.two, "wrapper two is running at second 6" ); - plus(); - ok( wrapperRunning.one, "wrapper one is running at second 6" ); - plus(); + if ( execCount === 1 ) { + + execCount++; + ok( wrapperRunning.two, "wrapper two is running at second 6" ); + plus(); + ok( wrapperRunning.one, "wrapper one is running at second 6" ); + plus(); + } }) // checking wrapper 1's end .exec( 7, function() { - ok( wrapperRunning.two, "wrapper two is running at second 7" ); - plus(); - ok( !wrapperRunning.one, "wrapper one is stopped at second 7" ); - plus(); + if ( execCount === 2 ) { + + execCount++; + ok( wrapperRunning.two, "wrapper two is running at second 7" ); + plus(); + ok( !wrapperRunning.one, "wrapper one is stopped at second 7" ); + plus(); + } }) // checking wrapper 2's end .exec( 8, function() { - ok( !wrapperRunning.two, "wrapper two is stopped at second 9" ); - plus(); - ok( !wrapperRunning.one, "wrapper one is stopped at second 9" ); - plus(); + if ( execCount === 3 ) { + + execCount++; + ok( !wrapperRunning.two, "wrapper two is stopped at second 9" ); + plus(); + ok( !wrapperRunning.one, "wrapper one is stopped at second 9" ); + plus(); + } }); p2.currentTime(3).play(); -- 2.43.0