@@ -70,52 +70,68 @@ test("jQuery.ajax() - success callbacks - (url, options) syntax", function() {
7070 } , 13 ) ;
7171} ) ;
7272
73- ajaxTest ( "jQuery.ajax() - do not execute js (crossOrigin)" , 2 , function ( assert ) {
74- return {
75- create : function ( options ) {
76- options . crossDomain = true ;
77- return jQuery . ajax ( url ( "data/script.php?header=ecma" ) , options ) ;
78- } ,
79- success : function ( ) {
80- assert . ok ( true , "success" ) ;
81- } ,
82- complete : function ( ) {
83- assert . ok ( true , "complete" ) ;
84- }
85- } ;
86- } ) ;
73+ test ( "jQuery.ajax() - do not execute js (crossOrigin) 1" , 2 , function ( ) {
8774
88- ajaxTest ( "jQuery.ajax() - execute js for crossOrigin when dataType option is provided" , 3 ,
89- function ( assert ) {
90- return {
91- create : function ( options ) {
92- options . crossDomain = true ;
93- options . dataType = "script" ;
94- return jQuery . ajax ( url ( "data/script.php?header=ecma" ) , options ) ;
75+ jQuery . ajaxSetup ( { timeout : 0 } ) ;
76+
77+ stop ( ) ;
78+
79+ setTimeout ( function ( ) {
80+ jQuery . ajax ( {
81+ url : url ( "data/script.php?header=ecma" ) ,
82+ crossDomain : true ,
83+ success : function ( ) {
84+ ok ( true , "success" ) ;
9585 } ,
86+ complete : function ( ) {
87+ ok ( true , "complete" ) ;
88+ start ( ) ;
89+ }
90+ } ) ;
91+ } , 13 ) ;
92+ } ) ;
93+
94+ test ( "jQuery.ajax() - execute js for crossOrigin when dataType option is provided" , 3 , function ( ) {
95+
96+ jQuery . ajaxSetup ( { timeout : 0 } ) ;
97+
98+ stop ( ) ;
99+
100+ setTimeout ( function ( ) {
101+ jQuery . ajax ( {
102+ url : url ( "data/script.php?header=ecma" ) ,
103+ crossDomain : true ,
104+ dataType : "script" ,
96105 success : function ( ) {
97- assert . ok ( true , "success" ) ;
106+ ok ( true , "success" ) ;
98107 } ,
99108 complete : function ( ) {
100- assert . ok ( true , "complete" ) ;
109+ ok ( true , "complete" ) ;
110+ start ( ) ;
101111 }
102- } ;
103- }
104- ) ;
112+ } ) ;
113+ } , 13 ) ;
114+ } ) ;
105115
106- ajaxTest ( "jQuery.ajax() - do not execute js (crossOrigin)" , 2 , function ( assert ) {
107- return {
108- create : function ( options ) {
109- options . crossDomain = true ;
110- return jQuery . ajax ( url ( "data/script.php" ) , options ) ;
111- } ,
112- success : function ( ) {
113- assert . ok ( true , "success" ) ;
114- } ,
115- complete : function ( ) {
116- assert . ok ( true , "complete" ) ;
117- }
118- } ;
116+ test ( "jQuery.ajax() - do not execute js (crossOrigin) 2" , 2 , function ( ) {
117+
118+ jQuery . ajaxSetup ( { timeout : 0 } ) ;
119+
120+ stop ( ) ;
121+
122+ setTimeout ( function ( ) {
123+ jQuery . ajax ( {
124+ url : url ( "data/script.php" ) ,
125+ crossDomain : true ,
126+ success : function ( ) {
127+ ok ( true , "success" ) ;
128+ } ,
129+ complete : function ( ) {
130+ ok ( true , "complete" ) ;
131+ start ( ) ;
132+ }
133+ } ) ;
134+ } , 13 ) ;
119135} ) ;
120136
121137test ( "jQuery.ajax() - success callbacks (late binding)" , function ( ) {
0 commit comments