Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var foobar = "bar"; | ||
var testBar = "bar"; | ||
jQuery('#ap').html('bar'); | ||
ok( true, "test.js executed"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ | |
*/ | ||
jQuery.noConflict(); | ||
|
||
// For checking globals pollution | ||
window[ jQuery.expando ] = undefined; | ||
// ...in Gecko | ||
this.getInterface = this.getInterface; | ||
// For checking globals pollution despite auto-created globals in various environments | ||
jQuery.each( [ jQuery.expando, "getInterface", "Packages", "java", "netscape" ], function( i, name ) { | ||
window[ name ] = window[ name ]; | ||
}); | ||
|
||
// Expose Sizzle for Sizzle's selector tests | ||
// We remove Sizzle's globalization in jQuery | ||
|
@@ -138,7 +138,7 @@ function testSubproject( label, url, risTests ) { | |
// Explanation at http://perfectionkills.com/understanding-delete/#ie_bugs | ||
var Globals = (function() { | ||
var globals = {}; | ||
return QUnit.config.noglobals ? { | ||
return { | ||
This comment has been minimized.
Sorry, something went wrong.
jaubourg
Member
|
||
register: function( name ) { | ||
globals[ name ] = true; | ||
jQuery.globalEval( "var " + name ); | ||
|
@@ -153,9 +153,6 @@ var Globals = (function() { | |
"; } catch( x ) {}" ); | ||
} | ||
} | ||
} : { | ||
register: jQuery.noop, | ||
cleanup: jQuery.noop | ||
}; | ||
})(); | ||
|
||
|
@@ -312,6 +309,9 @@ var Globals = (function() { | |
} | ||
if ( jQuery.active !== undefined && jQuery.active !== oldActive ) { | ||
equal( jQuery.active, 0, "No AJAX requests are still active" ); | ||
if ( ajaxTest.abort ) { | ||
ajaxTest.abort("active request"); | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
jaubourg
Member
|
||
oldActive = jQuery.active; | ||
} | ||
}; | ||
|
With this change, requests will never be aborted unless one of them immediately responds. If they don't immediately respond, by the time this code is hit, all requests have been "thened" and have no abort method. So if something goes wrong in an ajax test, we'll have dangling ajax requests potentially issueing asserts in the following tests (which is what the initial code was solving by separating the ajax request from the "thened" promise).
Unless I'm missing something, I don't really see the improvement here.