Core: Add test for jQuery.ready.promise fallback load

Fix #13655
Close gh-1209
Ref 32b066d3
parent 412555a0
<?php
sleep(10000);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../jquery.js"></script>
<script>var $j = jQuery.noConflict();</script>
</head>
<body>
<iframe id="dont_return" src="dont_return.php"></iframe>
<script>
var timeoutId, $,
timeoutFired = false;
setTimeout(function () {
// Load another jQuery copy using the first one.
$j.getScript( "../../../dist/jquery.js", function () {
$j( "#dont_return" ).attr( "src", "about:blank" );
// document ready handled by the just-loaded jQuery copy.
$(function () {
clearTimeout( timeoutId );
if ( !timeoutFired ) {
window.parent.iframeCallback( true );
}
});
});
timeoutId = setTimeout(function () {
timeoutFired = true;
window.parent.iframeCallback( false );
}, 3000);
});
</script>
</body>
</html>
...@@ -1486,6 +1486,11 @@ testIframeWithCallback( "Conditional compilation compatibility (#13274)", "core/ ...@@ -1486,6 +1486,11 @@ testIframeWithCallback( "Conditional compilation compatibility (#13274)", "core/
ok( $(), "jQuery executes" ); ok( $(), "jQuery executes" );
}); });
testIframeWithCallback( "document ready when jQuery loaded asynchronously (#13655)", "core/dynamic_ready.html", function( ready ) {
expect( 1 );
equal( true, ready, "document ready correctly fired when jQuery is loaded after DOMContentLoaded" );
});
testIframeWithCallback( "Tolerating alias-masked DOM properties (#14074)", "core/aliased.html", testIframeWithCallback( "Tolerating alias-masked DOM properties (#14074)", "core/aliased.html",
function( errors ) { function( errors ) {
expect( 1 ); expect( 1 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment