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).
This commit is contained in:
parent
4526c8b0a0
commit
38de389a8e
5 changed files with 85 additions and 33 deletions
32
test/unit/support.js
Normal file
32
test/unit/support.js
Normal file
|
@ -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( "<div/>" ).css( "display", noDisplay ? "none" : "block" ).append(
|
||||
jQuery( "<iframe/>" ).attr( "src", "data/support/" + url + ".html" )
|
||||
).appendTo( "body" );
|
||||
});
|
||||
}
|
||||
|
||||
supportIFrameTest( "proper boxModel in compatMode CSS1Compat (IE6 and IE7)", "boxModelIE", function( compatMode, boxModel ) {
|
||||
ok( compatMode !== "CSS1Compat" || boxModel, "boxModel properly detected" );
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue