From 0fcfac7568823a4eec4e5dd7b9bf527a8ec04f5c Mon Sep 17 00:00:00 2001 From: RafaC3ABl Blais Masson Date: Tue, 6 Dec 2011 16:17:09 -0500 Subject: Refine the jQuery.isWindow check. --- test/unit/core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/unit/core.js b/test/unit/core.js index d8906b89f..214b7ca5e 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -558,9 +558,10 @@ test("isXMLDoc - XML", function() { } test("isWindow", function() { - expect( 12 ); + expect( 14 ); ok( jQuery.isWindow(window), "window" ); + ok( jQuery.isWindow(document.getElementsByTagName("iframe")[0].contentWindow), "iframe.contentWindow" ); ok( !jQuery.isWindow(), "empty" ); ok( !jQuery.isWindow(null), "null" ); ok( !jQuery.isWindow(undefined), "undefined" ); @@ -570,8 +571,7 @@ test("isWindow", function() { ok( !jQuery.isWindow(1), "number" ); ok( !jQuery.isWindow(true), "boolean" ); ok( !jQuery.isWindow({}), "object" ); - // HMMM - // ok( !jQuery.isWindow({ setInterval: function(){} }), "fake window" ); + ok( !jQuery.isWindow({ setInterval: function(){} }), "fake window" ); ok( !jQuery.isWindow(/window/), "regexp" ); ok( !jQuery.isWindow(function(){}), "function" ); }); -- cgit v1.2.3