]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
trying out tests
authorAnna Sobiepanek <annaopensource@gmail.com>
Sun, 5 Dec 2010 21:12:17 +0000 (16:12 -0500)
committerAnna Sobiepanek <annaopensource@gmail.com>
Sun, 5 Dec 2010 21:12:17 +0000 (16:12 -0500)
plugins/webpage/popcorn.webpage.html
plugins/webpage/popcorn.webpage.unit.html
plugins/webpage/popcorn.webpage.unit.js

index 363e0ca18ee8224fbd81d7d7658c1e34f94151ef..a6855999b66b93a7d7a731a8049d865fbec40c36 100644 (file)
@@ -7,11 +7,9 @@
   <script src="popcorn.webpage.js"></script>
   <script>
     document.addEventListener('DOMContentLoaded', function () {
-      var p = Popcorn('#video');
-
-      p.play();  
-
-      p.webpages({
+      var p = Popcorn('#video')
+      .play() 
+      .webpages({
         id: "webpages-a", 
         start: 0, // seconds
         end: 5, // seconds
index 58ed2aaa25385ab792dfce02f35c477e9cda016c..8b2f866419ab3d30fea92834c51290d241ad375e 100644 (file)
@@ -3,7 +3,6 @@
 <head>
   <title>Popcorn API</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
-  <script src="../../test/jquery.js"></script>
   <script src="../../test/qunit/qunit.js"></script>
   <!-- 
     do not move - this must be called immediately prior to 
index e094fd60f94dd2e8af87dd3b707c8e788fa07317..d4825664fc2910089fa12675272cb415530e417d 100644 (file)
@@ -1,21 +1,38 @@
-$(function(){
+test("Popcorn Webpage Plugin", function () {
+  
+  
+  // needs expectation
 
-  test("Popcorn Webpage Plugin", function () {
+  var popped = Popcorn("#video"),
+      expects = 4,
+      count = 0;
+      
+  expect(expects);
+      
+  function plus (){
+    if(++count === expects){
+      stop();
+    }
+  }
+  
+  popped.webpages({
+      id: "webpages-a", 
+      start: 0, // seconds
+      end: 5, // seconds
+      src: 'http://www.webmademovies.org',
+      target: 'webpagediv'
+    });
     
-    
-    // needs expectation
-
-    var popped = Popcorn("#video");
-     
-    popped.webpages();
-    
-    
-    ok( 'data' in popped, "popped has the data prop and therefore is a Popcorn object" )
-    
-    ok( 'webpages' in popped, "webpages is a mehtod of the popped instance");
-    
-    ok( typeof popped.webpages === "function" , "webpages is in the plugins registry");
-
-    
-  });
-});
\ No newline at end of file
+  popped.play();
+  
+  
+  ok( 'data' in popped, "popped has the data prop and therefore is a Popcorn object" )
+  
+  ok( 'webpages' in popped, "webpages is a mehtod of the popped instance");
+  
+  ok( typeof popped.webpages === "function" , "webpages is a function");
+  
+  popped.exec(2, function(){
+    ok( document.getElementById('webpages-a') , "iframe exists");  
+  })
+});