From 38de389a8e675c0c2d1172dd23339325ae82539a Mon Sep 17 00:00:00 2001 From: jaubourg Date: Tue, 10 May 2011 12:23:53 +0200 Subject: [PATCH] Adds unit/support.js to unit tests. Still have to test for #8763 has to be done in its own file however, since Firefox refuses to notify global errors in the iframe (attachEvent, window.onerror and script.onerror all fail). --- test/boxModelIE.html | 33 --------------------------- test/data/support/boxModelIE.html | 27 ++++++++++++++++++++++ test/data/support/hiddenIFrameFF.html | 25 ++++++++++++++++++++ test/index.html | 1 + test/unit/support.js | 32 ++++++++++++++++++++++++++ 5 files changed, 85 insertions(+), 33 deletions(-) delete mode 100644 test/boxModelIE.html create mode 100644 test/data/support/boxModelIE.html create mode 100644 test/data/support/hiddenIFrameFF.html create mode 100644 test/unit/support.js diff --git a/test/boxModelIE.html b/test/boxModelIE.html deleted file mode 100644 index f8e6a431e..000000000 --- a/test/boxModelIE.html +++ /dev/null @@ -1,33 +0,0 @@ - - - -

jQuery Test boxModel detection in IE 6 & 7 compatMode="CSS1Compat"

-
document.compatMode = ?
-
jQuery.support.boxModel = ?
- - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/data/support/boxModelIE.html b/test/data/support/boxModelIE.html new file mode 100644 index 000000000..1b11d2a59 --- /dev/null +++ b/test/data/support/boxModelIE.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/data/support/hiddenIFrameFF.html b/test/data/support/hiddenIFrameFF.html new file mode 100644 index 000000000..000ac851a --- /dev/null +++ b/test/data/support/hiddenIFrameFF.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/index.html b/test/index.html index 3d421a565..4b4c98552 100644 --- a/test/index.html +++ b/test/index.html @@ -34,6 +34,7 @@ + diff --git a/test/unit/support.js b/test/unit/support.js new file mode 100644 index 000000000..9d99529a1 --- /dev/null +++ b/test/unit/support.js @@ -0,0 +1,32 @@ +module("support", { teardown: moduleTeardown }); + +function supportIFrameTest( title, url, noDisplay, func ) { + + if ( noDisplay !== true ) { + func = noDisplay; + noDisplay = false; + } + + test( title, function() { + var iframe; + + stop(); + window.supportCallback = function() { + var self = this, + args = arguments; + setTimeout( function() { + window.supportCallback = undefined; + iframe.remove(); + func.apply( self, args ); + start(); + }, 0 ); + }; + iframe = jQuery( "
" ).css( "display", noDisplay ? "none" : "block" ).append( + jQuery( "