assets/ckeditor/tests/plugins/widget/_helpers/tools.js
//											should have same definition name.
should have same definition name.
should have same definition name .
function assertDowncast( editorBot, id, expectedInstancesCount, expectedWidgetName ) {
		var data = CKEDITOR.document.getById( id ).getHtml();
		if ( typeof expectedInstancesCount == 'undefined' )
			expectedInstancesCount = 1;
		editorBot.setData( data, function() {
			var instancesArray = bender.tools.objToArray( editorBot.editor.widgets.instances );
			assert.areEqual( expectedInstancesCount, instancesArray.length, 'Invalid count of created widget instances.' );
			assert.areEqual( fixHtml( data ), fixHtml( editorBot.getData() ), 'Editor html after performing downcast is not matching.' );
			if ( expectedWidgetName ) {
				for ( var i = instancesArray.length - 1; i >= 0; i-- )
					assert.areEqual( expectedWidgetName, instancesArray[ i ].name, 'Widget at index ' + i + ' has widget invalid definition name.' );
			}
		} );
	}
function assertDowncast ( editorBot , id , expectedInstancesCount , expectedWidgetName ) { var data = CKEDITOR . document . getById ( id ) . getHtml ( ) ; if ( typeof expectedInstancesCount == 'undefined' ) expectedInstancesCount = 1 ; editorBot . setData ( data , function ( ) { var instancesArray = bender . tools . objToArray ( editorBot . editor . widgets . instances ) ; assert . areEqual ( expectedInstancesCount , instancesArray . length , 'Invalid count of created widget instances.' ) ; assert . areEqual ( fixHtml ( data ) , fixHtml ( editorBot . getData ( ) ) , 'Editor html after performing downcast is not matching.' ) ; if ( expectedWidgetName ) { for ( var i = instancesArray . length - 1 ; i >= 0 ; i -- ) assert . areEqual ( expectedWidgetName , instancesArray [ i ] . name , 'Widget at index ' + i + ' has widget invalid definition name.' ) ; } } ) ; }
should have same definition name.
should have same definition name .