Tests: Remove one of the checks for memory leak

This check is redundant since jQuery.fragments object does not exist anymore
(cherry-picked from 38c122a73a)
This commit is contained in:
Oleg 2014-01-14 21:48:42 +04:00
parent 3fbbe933ea
commit a3cd88f14b

View File

@ -7,7 +7,6 @@ var oldStart = window.start,
// Store the old counts so that we only assert on tests that have actually leaked, // Store the old counts so that we only assert on tests that have actually leaked,
// instead of asserting every time a test has leaked sometime in the past // instead of asserting every time a test has leaked sometime in the past
oldCacheLength = 0, oldCacheLength = 0,
oldFragmentsLength = 0,
oldActive = 0, oldActive = 0,
expectedDataKeys = {}, expectedDataKeys = {},
@ -118,7 +117,6 @@ QUnit.config.urlConfig.push({
window.moduleTeardown = function() { window.moduleTeardown = function() {
var i, var i,
expectedKeys, actualKeys, expectedKeys, actualKeys,
fragmentsLength = 0,
cacheLength = 0; cacheLength = 0;
// Only look for jQuery data problems if this test actually // Only look for jQuery data problems if this test actually
@ -163,22 +161,12 @@ window.moduleTeardown = function() {
++cacheLength; ++cacheLength;
} }
jQuery.fragments = {};
for ( i in jQuery.fragments ) {
++fragmentsLength;
}
// Because QUnit doesn't have a mechanism for retrieving the number of expected assertions for a test, // Because QUnit doesn't have a mechanism for retrieving the number of expected assertions for a test,
// if we unconditionally assert any of these, the test will fail with too many assertions :| // if we unconditionally assert any of these, the test will fail with too many assertions :|
if ( cacheLength !== oldCacheLength ) { if ( cacheLength !== oldCacheLength ) {
equal( cacheLength, oldCacheLength, "No unit tests leak memory in jQuery.cache" ); equal( cacheLength, oldCacheLength, "No unit tests leak memory in jQuery.cache" );
oldCacheLength = cacheLength; oldCacheLength = cacheLength;
} }
if ( fragmentsLength !== oldFragmentsLength ) {
equal( fragmentsLength, oldFragmentsLength, "No unit tests leak memory in jQuery.fragments" );
oldFragmentsLength = fragmentsLength;
}
}; };
QUnit.done(function() { QUnit.done(function() {