]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
practice test, should never be seen
authorScottDowne <sdowne@learn.senecac.on.ca>
Thu, 16 Dec 2010 21:18:03 +0000 (16:18 -0500)
committerScottDowne <sdowne@learn.senecac.on.ca>
Thu, 16 Dec 2010 21:18:03 +0000 (16:18 -0500)
test/popcorn.unit.js

index 3db982f98b6080fceaaa8f45115e95721dc5daed..b403d5be99818a81b52dd088cb0f05988567165c 100644 (file)
@@ -768,10 +768,61 @@ test("Functions", function () {
   
   equals( trackEvents.length, 3, "3 user created trackEvents returned by popped.getTrackEvents()" )  
   
+  /*popped.rw({
+    start: 1, 
+    end: 2
+  });  
 
+  var newTrackId = popped.getLastTrackEventId();
+
+  popped.currentTime(1).play();*/
+  
 });
 
 
+test("Update Index", function () {
+
+  QUnit.reset();
+
+  var p3 = Popcorn("#video"),                         
+      expects = 4, 
+      count   = 0;
+
+  function plus() {
+    if ( ++count === expects ) {
+      start(); 
+      // clean up added events after tests
+      p2.removePlugin("track");
+    }
+  }
+  
+  stop();  
+
+  Popcorn.plugin("track", function () {
+    return {
+      start: function () {
+        forwardStart = !forwardStart;
+        ok( forwardStart, "forward's start fired");
+        plus();
+      },
+      end: function () {
+        forwardEnd = !forwardEnd;
+        p2.currentTime(1).play();
+        ok( forwardEnd, "forward's end fired");
+        plus();
+      }
+    };
+  });
+
+  p3.track({
+    start: 1, 
+    end: 2
+  });
+
+  p3.currentTime(1).play().currentTime(1).play().removeTrackEvent(p3.getLastTrackEventId());
+
+});
+
 module("Popcorn XHR");
 test("Basic", function () {