From 5472b203bab9675912c3926d1b102f5f7d8d5abb Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Mon, 11 Apr 2011 11:14:48 -0400 Subject: [PATCH] [#468] popcorn.position audio test --- popcorn.js | 2 +- test/popcorn.unit.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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(); }); -- 2.43.0