Index: /CKEditor/tests/tt/4901/1.html
===================================================================
--- /CKEditor/tests/tt/4901/1.html	(revision 4813)
+++ /CKEditor/tests/tt/4901/1.html	(revision 4813)
@@ -0,0 +1,163 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<title>Ticket: #4901</title>
+	<meta name="tags" content="editor,unit,stable">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script>
+( function()
+{
+	var ts, tc, test = CKEDITOR.test, assert = CKEDITOR.test.assert;
+	function getTextAreaContent( id )
+	{
+		return CKEDITOR.test.fixHtml( CKEDITOR.document.getById( id ).getValue(), true, false );
+	}
+
+	YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
+		{
+				editorName : 'editor1'
+		} ) );
+
+	ts.add( tc = new YAHOO.tool.TestCase(
+		{
+			setUp : function ()
+			{
+				// Force result data unformatted.
+				ts.editor.dataProcessor.writer._.rules = {};
+				// Force remove tail br.
+				ts.editor.dataProcessor.htmlFilter.addRules( {
+					elements : {
+						'br' : function( br ){
+							var parent = br.parent,
+								length = parent.children.length,
+								lastChild = parent.children[ length - 1 ];
+							if( lastChild == br )
+								return false;
+						}
+					}
+				} );
+				ts.editor.focus();
+			},
+
+			/**
+			 * Test create link with target setting to popup with features. 
+			 */
+			test_create_link_target_popup : function()
+			{
+				var editor = ts.editor,
+					command = 'link';
+
+				editor.execCommand( command );
+
+				// waiting for dialog to open.
+				this.wait( function()
+				{
+					 var dialog = editor._.storedDialogs[ command ],
+						 urlField = dialog.getContentElement( 'info', 'url' ),
+						 linkTargetTypeField = dialog.getContentElement( 'target', 'linkTargetType' ),
+						 linkTargetNameField = dialog.getContentElement( 'target', 'linkTargetName' ),
+						 targetFeatureResizableField = dialog.getContentElement( 'target', 'resizable' ),
+						 targetFeatureStatusField = dialog.getContentElement( 'target', 'status' ),
+						 targetFeatureLocationField = dialog.getContentElement( 'target', 'location' ),
+						 targetFeatureToolbarField = dialog.getContentElement( 'target', 'toolbar' ),
+						 targetFeatureMenubarField = dialog.getContentElement( 'target', 'menubar' ),
+						 targetFeatureFullscreenField = dialog.getContentElement( 'target', 'fullscreen' ),
+						 targetFeatureScrollbarField = dialog.getContentElement( 'target', 'scrollbars' ),
+						 targetFeatureDependentField = dialog.getContentElement( 'target', 'dependent' ),
+						 targetFeatureWidthField = dialog.getContentElement( 'target', 'width' ),
+						 targetFeatureHeightField = dialog.getContentElement( 'target', 'height' ),
+						 targetFeatureTopField = dialog.getContentElement( 'target', 'top' ),
+						 targetFeatureLeftField = dialog.getContentElement( 'target', 'left' );
+
+					urlField.setValue( 'ckeditor.com' );
+					linkTargetTypeField.setValue( 'popup' );
+					targetFeatureResizableField.setValue( true );
+					targetFeatureStatusField.setValue( true );
+					targetFeatureLocationField.setValue( true );
+					targetFeatureToolbarField.setValue( true );
+					targetFeatureMenubarField.setValue( true );
+					targetFeatureFullscreenField.setValue( true );
+					targetFeatureScrollbarField.setValue( true );
+					targetFeatureDependentField.setValue( true );
+					targetFeatureWidthField.setValue( 500 );
+					targetFeatureHeightField.setValue( 300 );
+					targetFeatureLeftField.setValue( 200 );
+					targetFeatureTopField.setValue( 100 );
+					dialog.fire( 'ok' );
+					dialog.hide();
+
+					var result = editor.getData();
+					assert.areEqual( getTextAreaContent( 'link-output' ), result, 'Inserted link doesn\'t match.' );
+
+				}, 1000 );
+			},
+
+			/**
+			 * Test edit link with popup target of features.  
+			 */
+			test_edit_link_target_popup : function()
+			{
+				var editor = ts.editor,
+					command = 'link';
+
+				var body = editor.document.getBody(),
+					range = new CKEDITOR.dom.range( editor.document );
+				range.selectNodeContents( body.getChild( [ 0, 0 ] ) );
+				range.select();
+				editor.execCommand( command );
+
+				// waiting for dialog to open.
+				this.wait( function()
+				{
+					 var dialog = editor._.storedDialogs[ command ],
+						 urlField = dialog.getContentElement( 'info', 'url' ),
+						 linkTargetTypeField = dialog.getContentElement( 'target', 'linkTargetType' ),
+						 linkTargetNameField = dialog.getContentElement( 'target', 'linkTargetName' ),
+						 targetFeatureResizableField = dialog.getContentElement( 'target', 'resizable' ),
+						 targetFeatureStatusField = dialog.getContentElement( 'target', 'status' ),
+						 targetFeatureLocationField = dialog.getContentElement( 'target', 'location' ),
+						 targetFeatureToolbarField = dialog.getContentElement( 'target', 'toolbar' ),
+						 targetFeatureMenubarField = dialog.getContentElement( 'target', 'menubar' ),
+						 targetFeatureFullscreenField = dialog.getContentElement( 'target', 'fullscreen' ),
+						 targetFeatureScrollbarField = dialog.getContentElement( 'target', 'scrollbars' ),
+						 targetFeatureDependentField = dialog.getContentElement( 'target', 'dependent' ),
+						 targetFeatureWidthField = dialog.getContentElement( 'target', 'width' ),
+						 targetFeatureHeightField = dialog.getContentElement( 'target', 'height' ),
+						 targetFeatureTopField = dialog.getContentElement( 'target', 'top' ),
+						 targetFeatureLeftField = dialog.getContentElement( 'target', 'left' );
+
+					targetFeatureResizableField.setValue( false );
+					targetFeatureStatusField.setValue( false );
+					targetFeatureLocationField.setValue( false );
+					targetFeatureToolbarField.setValue( false );
+					targetFeatureMenubarField.setValue( false );
+					targetFeatureFullscreenField.setValue( false );
+					targetFeatureScrollbarField.setValue( false );
+					targetFeatureDependentField.setValue( false );
+					targetFeatureWidthField.setValue();
+					targetFeatureHeightField.setValue();
+					targetFeatureLeftField.setValue();
+					targetFeatureTopField.setValue();
+					dialog.fire( 'ok' );
+					dialog.hide();
+
+					var result = editor.getData();
+					assert.areEqual( getTextAreaContent( 'link-output2' ), result, 'Editing link result doesn\'t match.' );
+
+				}, 1000 );
+			}
+
+		} ) );
+} )();
+	</script>
+</head>
+<body>
+<textarea id="link-output">
+<p><a href="http://ckeditor.com" onclick="window.open(this.href, '', 'resizable=yes,status=yes,location=yes,toolbar=yes,menubar=yes,fullscreen=yes,scrollbars=yes,dependent=yes,width=500,left=200,height=300,top=100'); return false;">http://ckeditor.com</a></p>
+</textarea>
+<textarea id="link-output2">
+<p><a href="http://ckeditor.com" onclick="window.open(this.href, '', 'resizable=no,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no'); return false;">http://ckeditor.com</a></p>
+</textarea>
+</body>
+</html>
