From: ScottDowne Date: Mon, 11 Apr 2011 15:14:48 +0000 (-0400) Subject: [#468] popcorn.position audio test X-Git-Tag: v0.5~31^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=5472b203bab9675912c3926d1b102f5f7d8d5abb;p=popcorn-js.git [#468] popcorn.position audio test --- diff --git a/popcorn.js b/popcorn.js index 43889ee..d4f2f9c 100644 --- a/popcorn.js +++ b/popcorn.js @@ -404,7 +404,7 @@ // Popcorn Object Element Utils position: function() { - var media = this.video, + var media = this.media, clientRect = media.getBoundingClientRect(), bounds = {}, doc = media.ownerDocument, diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 59e0b9a..cf91ea7 100755 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -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(); });