]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#349] Update exec unit tests to reflect Popcorn.events internals change
authorrwldrn <waldron.rick@gmail.com>
Wed, 16 Feb 2011 19:45:43 +0000 (14:45 -0500)
committerrwldrn <waldron.rick@gmail.com>
Wed, 16 Feb 2011 19:45:43 +0000 (14:45 -0500)
popcorn.js
test/popcorn.unit.js

index 9f63c0c3967a259a0bec1bc8adda073887f1460a..1bd7278f54db903a304abb8ba2d91c9529beb7e4 100644 (file)
               
               callback.fired = true;
               
-              this.unlisten("timeupdate", guid );
-              
               fn.call(self, event);
               
+              setTimeout(function() {
+                
+                callback.fired = false;
+                
+              }, 500 );
             }
           };
       
index c1660c1514f50fc088742482096ddbaff8143ddb..5db3bb29d984228207ccd71a8632379585bf1e59 100644 (file)
@@ -175,7 +175,9 @@ test("exec", function () {
   
   var popped = Popcorn("#video"),
       expects = 2, 
-      count = 0;
+      count = 0, 
+      hasLooped = false, 
+      loop = 0;
 
   expect(expects);
   
@@ -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();
-  
-  
 
 });