mirror of
https://github.com/jquery/jquery.git
synced 2026-02-05 17:25:02 -05:00
Tests: Refactor testIframe() to make it DRYer and more consistent
Ref gh-3040 Closes gh-3049
This commit is contained in:
@@ -2476,10 +2476,10 @@ QUnit.test( "focusin using non-element targets", function( assert ) {
|
||||
|
||||
} );
|
||||
|
||||
testIframeWithCallback(
|
||||
testIframe(
|
||||
"focusin from an iframe",
|
||||
"event/focusinCrossFrame.html",
|
||||
function( frameDoc, assert ) {
|
||||
function( assert, framejQuery, frameWin, frameDoc ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var input = jQuery( frameDoc ).find( "#frame-input" );
|
||||
@@ -2507,10 +2507,10 @@ testIframeWithCallback(
|
||||
}
|
||||
);
|
||||
|
||||
testIframeWithCallback(
|
||||
testIframe(
|
||||
"jQuery.ready promise",
|
||||
"event/promiseReady.html",
|
||||
function( isOk, assert ) {
|
||||
function( assert, jQuery, window, document, isOk ) {
|
||||
assert.expect( 1 );
|
||||
assert.ok( isOk, "$.when( $.ready ) works" );
|
||||
}
|
||||
@@ -2518,29 +2518,29 @@ testIframeWithCallback(
|
||||
|
||||
// need PHP here to make the incepted IFRAME hang
|
||||
if ( hasPHP ) {
|
||||
testIframeWithCallback(
|
||||
testIframe(
|
||||
"jQuery.ready uses interactive",
|
||||
"event/interactiveReady.html",
|
||||
function( isOk, assert ) {
|
||||
function( assert, jQuery, window, document, isOk ) {
|
||||
assert.expect( 1 );
|
||||
assert.ok( isOk, "jQuery fires ready when the DOM can truly be interacted with" );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
testIframeWithCallback(
|
||||
testIframe(
|
||||
"Focusing iframe element",
|
||||
"event/focusElem.html",
|
||||
function( isOk, assert ) {
|
||||
function( assert, jQuery, window, document, isOk ) {
|
||||
assert.expect( 1 );
|
||||
assert.ok( isOk, "Focused an element in an iframe" );
|
||||
}
|
||||
);
|
||||
|
||||
testIframeWithCallback(
|
||||
testIframe(
|
||||
"triggerHandler(onbeforeunload)",
|
||||
"event/triggerunload.html",
|
||||
function( isOk, assert ) {
|
||||
function( assert, jQuery, window, document, isOk ) {
|
||||
assert.expect( 1 );
|
||||
assert.ok( isOk, "Triggered onbeforeunload without an error" );
|
||||
}
|
||||
@@ -2548,10 +2548,10 @@ testIframeWithCallback(
|
||||
|
||||
// need PHP here to make the incepted IFRAME hang
|
||||
if ( hasPHP ) {
|
||||
testIframeWithCallback(
|
||||
testIframe(
|
||||
"jQuery.ready synchronous load with long loading subresources",
|
||||
"event/syncReady.html",
|
||||
function( isOk, assert ) {
|
||||
function( assert, jQuery, window, document, isOk ) {
|
||||
assert.expect( 1 );
|
||||
assert.ok( isOk, "jQuery loaded synchronously fires ready when the DOM can truly be interacted with" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user