Skip to content
Permalink
Browse files

Tests: Fix failing ajax tests in oldIE

(cherry-picked from the 7178096)

Picked up so tests from the 1.x-master would be more similar to this branch
  • Loading branch information
markelog committed Apr 4, 2014
1 parent 1dedd31 commit f3b89ba0820882bd4ce4404b7e7c819e7b506de5
Showing with 18 additions and 14 deletions.
  1. +1 −1 test/data/test.html
  2. +2 −2 test/data/test.php
  3. +1 −1 test/data/{test.js → testbar.php}
  4. +13 −9 test/unit/ajax.js
  5. +1 −1 test/unit/manipulation.js
@@ -3,5 +3,5 @@
testFoo = "foo"; jQuery('#foo').html('foo');
ok( true, "test.html executed" );
/* ]]> */</script>
<script src="data/test.js"></script>
<script src="data/testbar.php"></script>
blabla
@@ -3,5 +3,5 @@
testFoo = "foo"; jQuery('#foo').html('foo');
ok( true, "test.php executed" );
/* ]]> */</script>
<script src="data/test.js?<?php srand(); echo time() . '' . rand(); ?>"></script>
blabla
<script src="data/testbar.php?<?php srand(); echo time() . '' . rand(); ?>"></script>
blabla
@@ -1,3 +1,3 @@
this.testBar = "bar";
jQuery("#ap").html("bar");
ok( true, "test.js executed");
ok( true, "testbar.php executed");
@@ -607,7 +607,7 @@ module( "ajax", {

ok( jQuery.get( url(target), success ), "get" );
ok( jQuery.post( url(target), success ), "post" );
ok( jQuery.getScript( url("data/test.js"), success ), "script" );
ok( jQuery.getScript( url("data/testbar.php"), success ), "script" );
ok( jQuery.getJSON( url("data/json_obj.js"), success ), "json" );
ok( jQuery.ajax({
url: url( target ),
@@ -855,7 +855,7 @@ module( "ajax", {
setup: function() {
Globals.register("testBar");
},
url: window.location.href.replace( /[^\/]*$/, "" ) + "data/test.js",
url: window.location.href.replace( /[^\/]*$/, "" ) + "data/testbar.php",
dataType: "script",
success: function() {
strictEqual( window["testBar"], "bar", "Script results returned (GET, no callback)" );
@@ -866,7 +866,7 @@ module( "ajax", {
setup: function() {
Globals.register("testBar");
},
url: window.location.href.replace( /[^\/]*$/, "" ) + "data/test.js",
url: window.location.href.replace( /[^\/]*$/, "" ) + "data/testbar.php",
type: "POST",
dataType: "script",
success: function( data, status ) {
@@ -879,7 +879,7 @@ module( "ajax", {
setup: function() {
Globals.register("testBar");
},
url: window.location.href.replace( /[^\/]*$/, "" ).replace( /^.*?\/\//, "//" ) + "data/test.js",
url: window.location.href.replace( /[^\/]*$/, "" ).replace( /^.*?\/\//, "//" ) + "data/testbar.php",
dataType: "script",
success: function() {
strictEqual( window["testBar"], "bar", "Script results returned (GET, no callback)" );
@@ -1733,20 +1733,20 @@ module( "ajax", {

asyncTest( "jQuery.getScript( String, Function ) - with callback", 2, function() {
Globals.register("testBar");
jQuery.getScript( url("data/test.js"), function() {
jQuery.getScript( url("data/testbar.php"), function() {
strictEqual( window["testBar"], "bar", "Check if script was evaluated" );
start();
});
});

asyncTest( "jQuery.getScript( String, Function ) - no callback", 1, function() {
Globals.register("testBar");
jQuery.getScript( url("data/test.js") ).done( start );
jQuery.getScript( url("data/testbar.php") ).done( start );
});

asyncTest( "#8082 - jQuery.getScript( String, Function ) - source as responseText", 2, function() {
Globals.register("testBar");
jQuery.getScript( url("data/test.js"), function( data, _, jqXHR ) {
jQuery.getScript( url("data/testbar.php"), function( data, _, jqXHR ) {
strictEqual( data, jqXHR.responseText, "Same-domain script requests returns the source of the script" );
start();
});
@@ -1974,7 +1974,9 @@ module( "ajax", {
strictEqual( data, "test%5Blength%5D=7&test%5Bfoo%5D=bar", "Check if a sub-object with a length param is serialized correctly" );
}
})
).always( start );
).always(function() {
start();
});
});

asyncTest( "jQuery.post( String, Hash, Function ) - simple with xml", 4, function() {
@@ -1997,7 +1999,9 @@ module( "ajax", {
strictEqual( jQuery( "result", this ).text(), "3", "Check for XML" );
});
})
).always( start );
).always(function() {
start();
});
});

//----------- jQuery.active
@@ -2284,7 +2284,7 @@ test( "script evaluation (#11795)", function() {

if ( jQuery.ajax ) {
Globals.register("testBar");
jQuery("#qunit-fixture").append( "<script src='" + url("data/test.js") + "'/>" );
jQuery("#qunit-fixture").append( "<script src='" + url("data/testbar.php") + "'/>" );
strictEqual( window["testBar"], "bar", "Global script evaluation" );
} else {
ok( true, "No jQuery.ajax" );

0 comments on commit f3b89ba

Please sign in to comment.
You can’t perform that action at this time.