function checkControl(oControlClass, assert) {
		var sControlName = oControlClass.getMetadata().getName();

		var //mPrePreElements = Element.registry.all(),
			oControl1 = new oControlClass(),
			bCanRender = false;

		// check whether this control can be rendered
		if (oControl1.placeAt) {

			try {
				oControl1.getMetadata().getRenderer();
				bCanRender = true;
			} catch (e) {
				// ignoring this control's rendering, message is written below
			}
		}


		// Render Control Instance 1 - some control types statically create something for re-use across all instances

		fillControlProperties(oControl1);

		if (bCanRender) {
			oControl1.placeAt("qunit-fixture");
			sap.ui.getCore().applyChanges();
		} else {
			// reported below
		}

		oControl1.destroy();
		sap.ui.getCore().applyChanges();


		// Render Control Instance 2 - any new controls leaked?

		var mPreElements = Element.registry.all(),
			oControl2 = new oControlClass();

		fillControlProperties(oControl2);

		if (bCanRender) {
			oControl2.placeAt("qunit-fixture");
			sap.ui.getCore().applyChanges();

			oControl2.rerender();  // just re-render again - this finds problems
			sap.ui.getCore().applyChanges();

			iFullyTestedControls++;
		} else {
			iTestedWithoutRenderingControls++;
			assert.ok(true, "WARNING: " + sControlName + " cannot be rendered");
		}


		// check what's left after destruction

		oControl2.destroy();
		sap.ui.getCore().applyChanges();
		var mPostElements = Element.registry.all();

		// controls left over by second instance are real leaks that will grow proportionally to instance count => ERROR
		assert.equalElementsInControlList(mPostElements, mPreElements, "Memory leak check in " + sControlName);

		// controls left over by first instance are either real leaks or one-time static leaks, which we accept
		//assert.equalElementsInControlList(mPreElements, mPrePreElements, "Static leak check (WARNING ONLY!!) in " + sControlName);
	}
// Has some special logic to ignore or work around problems where certain controls do not work standalone.
Has some special logic to ignore or work around problems where certain controls do not work standalone.
Has some special logic to ignore or work around problems where certain controls do not work standalone .
function checkControl(oControlClass, assert) {
		var sControlName = oControlClass.getMetadata().getName();
		var 
			oControl1 = new oControlClass(),
			bCanRender = false;
		if (oControl1.placeAt) {
			try {
				oControl1.getMetadata().getRenderer();
				bCanRender = true;
			} catch (e) {
			}
		}
		fillControlProperties(oControl1);
		if (bCanRender) {
			oControl1.placeAt("qunit-fixture");
			sap.ui.getCore().applyChanges();
		} else {
		}
		oControl1.destroy();
		sap.ui.getCore().applyChanges();
		var mPreElements = Element.registry.all(),
			oControl2 = new oControlClass();
		fillControlProperties(oControl2);
		if (bCanRender) {
			oControl2.placeAt("qunit-fixture");
			sap.ui.getCore().applyChanges();
			oControl2.rerender();  
			sap.ui.getCore().applyChanges();
			iFullyTestedControls++;
		} else {
			iTestedWithoutRenderingControls++;
			assert.ok(true, "WARNING: " + sControlName + " cannot be rendered");
		}
		oControl2.destroy();
		sap.ui.getCore().applyChanges();
		var mPostElements = Element.registry.all();
		assert.equalElementsInControlList(mPostElements, mPreElements, "Memory leak check in " + sControlName);
	}
function checkControl ( oControlClass , assert ) { var sControlName = oControlClass . getMetadata ( ) . getName ( ) ; var oControl1 = new oControlClass ( ) , bCanRender = false ; if ( oControl1 . placeAt ) { try { oControl1 . getMetadata ( ) . getRenderer ( ) ; bCanRender = true ; } catch ( e ) { } } fillControlProperties ( oControl1 ) ; if ( bCanRender ) { oControl1 . placeAt ( "qunit-fixture" ) ; sap . ui . getCore ( ) . applyChanges ( ) ; } else { } oControl1 . destroy ( ) ; sap . ui . getCore ( ) . applyChanges ( ) ; var mPreElements = Element . registry . all ( ) , oControl2 = new oControlClass ( ) ; fillControlProperties ( oControl2 ) ; if ( bCanRender ) { oControl2 . placeAt ( "qunit-fixture" ) ; sap . ui . getCore ( ) . applyChanges ( ) ; oControl2 . rerender ( ) ; sap . ui . getCore ( ) . applyChanges ( ) ; iFullyTestedControls ++ ; } else { iTestedWithoutRenderingControls ++ ; assert . ok ( true , "WARNING: " + sControlName + " cannot be rendered" ) ; } oControl2 . destroy ( ) ; sap . ui . getCore ( ) . applyChanges ( ) ; var mPostElements = Element . registry . all ( ) ; assert . equalElementsInControlList ( mPostElements , mPreElements , "Memory leak check in " + sControlName ) ; }
Has some special logic to ignore or work around problems where certain controls do not work standalone.
Has some special logic to ignore or work around problems where certain controls do not work standalone .
//mPrePreElements = Element.registry.all(), // check whether this control can be rendered // ignoring this control's rendering, message is written below // Render Control Instance 1 - some control types statically create something for re-use across all instances // reported below // Render Control Instance 2 - any new controls leaked? // just re-render again - this finds problems // check what's left after destruction // controls left over by second instance are real leaks that will grow proportionally to instance count => ERROR // controls left over by first instance are either real leaks or one-time static leaks, which we accept //assert.equalElementsInControlList(mPreElements, mPrePreElements, "Static leak check (WARNING ONLY!!) in " + sControlName);