]> source.dussan.org Git - jquery.git/commitdiff
Tests: Fix failing ajax tests in oldIE
authorOleg Gaidarenko <markelog@gmail.com>
Fri, 4 Apr 2014 18:31:38 +0000 (22:31 +0400)
committerOleg Gaidarenko <markelog@gmail.com>
Tue, 15 Apr 2014 13:46:26 +0000 (17:46 +0400)
test/data/test.html
test/data/test.js [deleted file]
test/data/test.php
test/data/testbar.php [new file with mode: 0644]
test/unit/ajax.js
test/unit/manipulation.js

index eec028e90f92b824b095f8cd824fe474b420c300..f5bc2199fc3cd564226a35f6115adb052d790202 100644 (file)
@@ -3,5 +3,5 @@ html text<br/>
 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
diff --git a/test/data/test.js b/test/data/test.js
deleted file mode 100644 (file)
index fb33952..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-this.testBar = "bar";
-jQuery("#ap").html("bar");
-ok( true, "test.js executed");
index 3d08f3253ad3fbd381862165ed63998d45e801dd..d93dafad823578aeb284f03a4b044a87cf32f52b 100644 (file)
@@ -3,5 +3,5 @@ html text<br/>
 testFoo = "foo"; jQuery('#foo').html('foo');
 ok( true, "test.php executed" );
 /* ]]> */</script>
-<script src="data/test.js?<?php srand(); echo time() . '' . rand(); ?>"></script>
-blabla
\ No newline at end of file
+<script src="data/testbar.php?<?php srand(); echo time() . '' . rand(); ?>"></script>
+blabla
diff --git a/test/data/testbar.php b/test/data/testbar.php
new file mode 100644 (file)
index 0000000..21aa688
--- /dev/null
@@ -0,0 +1,3 @@
+this.testBar = "bar";
+jQuery("#ap").html("bar");
+ok( true, "testbar.php executed");
index 3a2ac11c43a20851e1f9db46065c95929b46245e..8dd97405a9ed5aa3f43076642c0443a257b26fd7 100644 (file)
@@ -602,7 +602,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 ),
@@ -850,7 +850,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)" );
@@ -861,7 +861,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 ) {
@@ -874,7 +874,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)" );
@@ -1776,7 +1776,7 @@ 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();
                });
@@ -1784,12 +1784,12 @@ module( "ajax", {
 
        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();
                });
@@ -2017,7 +2017,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() {
@@ -2040,7 +2042,9 @@ module( "ajax", {
                                        strictEqual( jQuery( "result", this ).text(), "3", "Check for XML" );
                                });
                        })
-               ).always( start );
+               ).always(function() {
+                       start();
+               });
        });
 
 //----------- jQuery.active
index f403d8f8e03eb409b205c642f68d5a171a7b9e6c..48d5f398788b3412b39e88f95b5b32d05a8583ba 100644 (file)
@@ -2348,7 +2348,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" );