]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#468] popcorn.position audio test
authorScottDowne <sdowne@learn.senecac.on.ca>
Mon, 11 Apr 2011 15:14:48 +0000 (11:14 -0400)
committerScottDowne <sdowne@learn.senecac.on.ca>
Mon, 11 Apr 2011 15:14:48 +0000 (11:14 -0400)
popcorn.js
test/popcorn.unit.js

index 43889ee9637ee78189002d85e51a17457262513f..d4f2f9c55dee8f99497dd36e4536841c5318231e 100644 (file)
 
     //  Popcorn Object Element Utils
     position: function() {
-      var  media = this.video,  
+      var  media = this.media,  
           clientRect = media.getBoundingClientRect(),
           bounds = {}, 
           doc = media.ownerDocument,
index 59e0b9a9e49e1c6920575dba76636bac1c5a9e98..cf91ea7c7a09bb626962b24117e13220769a4fce 100755 (executable)
@@ -343,7 +343,7 @@ test("exec", function () {
 module("Popcorn Position");
 test("position", function () {
 
-       expect(24);
+       expect(25);
        
   var $absolute = $(".absolute"), 
       $relative = $(".relative"), 
@@ -401,6 +401,11 @@ test("position", function () {
     equals( Popcorn( "#vid-" + test.id ).position().left, test.left, "Popcorn('#vid-" + test.id + "').position().left" );
   });
 
+  try {
+    ok( Popcorn( "#audio" ).position(), "position called from audio" );
+  } catch( e ) {
+    ok( false, e );
+  }
 
        $("#position-tests").hide();
 });