Index: CKEditor/tests/tt/3950/1.html
===================================================================
--- CKEditor/tests/tt/3950/1.html	(revision 4515)
+++ CKEditor/tests/tt/3950/1.html	(revision 6535)
@@ -3,34 +3,189 @@
 <html>
 <head>
-	<title>Ticket: #3950</title>
-	<meta name="tags" content="editor,manual,all">
+	<title>Ticket: #3950 Insert Row and column before and after cell</title>
+	<meta name="tags" content="editor,unit,all">
 	<script type="text/javascript" src="../../cktester/cell.js"></script>
 	<script>
-		// Prevent the default editor been created.
-		YAHOO.util.Event.removeListener( window, 'load' );
-		window.onload = function ()
+( function()
+{
+	var ts, tc, assert = CKEDITOR.test.assert, test = CKEDITOR.test, selector = YAHOO.util.Selector;
+
+	YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
 		{
-			CKEDITOR.replace( 'editor1' );
+				editorName : 'test_editor_1',
+				name :document.title
+		} ) );
+
+	ts.add( tc = new YAHOO.tool.TestCase(
+	{
+		setUp : function ()
+		{
+			// Force result data un-formatted.
+			ts.editor.dataProcessor.writer._.rules = {};
+			ts.editor.focus();
+		},
+
+		test_insert_row_before: function()
+		{
+			var editor = ts.editor,
+				output = '<table width="200"><tbody><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>cell1</td><td>cell2</td></tr></tbody></table>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_1' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			editor.execCommand( 'rowInsertBefore' );
+			this.wait( function ()
+			{											
+				assert.areSame( output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_row_after: function()
+		{
+			var editor = ts.editor,
+				output = '<table width="200"><tbody><tr><td>cell1</td><td>cell2</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_1' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			editor.execCommand( 'rowInsertAfter' );
+			this.wait( function ()
+			{											
+				assert.areSame( output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_column_before: function()
+		{
+			var editor = ts.editor,
+				output = '<table width="200"><tbody><tr><td>&nbsp;</td><td>cell1</td><td>cell2</td></tr></tbody></table>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_2' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			editor.execCommand( 'columnInsertBefore' );
+			this.wait( function ()
+			{											
+				assert.areSame( output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_column_after: function()
+		{
+			var editor = ts.editor,
+				output = '<table width="200"><tbody><tr><td>cell1</td><td>&nbsp;</td><td>cell2</td></tr></tbody></table>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_2' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			editor.execCommand( 'columnInsertAfter' );
+			this.wait( function ()
+			{											
+				assert.areSame( output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_row_before_selection: function()
+		{
+			var editor = ts.editor,
+				output = '<table width="200"><tbody><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>cell1</td><td>cell2</td></tr></tbody></table>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_3' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			editor.execCommand( 'rowInsertBefore' );
+			this.wait( function ()
+			{											
+				assert.areSame( output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_row_after_selection: function()
+		{
+			var editor = ts.editor,
+				output = '<table width="200"><tbody><tr><td>cell1</td><td>cell2</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_3' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			editor.execCommand( 'rowInsertAfter' );
+			this.wait( function ()
+			{											
+				assert.areSame( output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_column_before_selection: function()
+		{
+			var editor = ts.editor,
+				output = '<table width="200"><tbody><tr><td>&nbsp;</td><td>cell1</td><td>cell2</td></tr></tbody></table>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_4' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			editor.execCommand( 'columnInsertBefore' );
+			this.wait( function ()
+			{											
+				assert.areSame( output, editor.getData() );
+			}, 1000 );
+		},
+		
+		test_insert_column_after_selection: function()
+		{
+			var editor = ts.editor,
+				output = '<table width="200"><tbody><tr><td>cell1</td><td>&nbsp;</td><td>cell2</td></tr></tbody></table>';
+				
+			contentWithSelection = test.getValueAsHtml( 'input_4' );
+			test.setHtmlWithSelection( editor.document.getBody(), contentWithSelection );
+			editor.execCommand( 'columnInsertAfter' );
+			this.wait( function ()
+			{											
+				assert.areSame( output, editor.getData() );
+			}, 1000 );
 		}
+	} ) );
+} )();
 	</script>
 </head>
 <body>
-<pre>
-=== Test Insert Row Before/After Cell===
- 1. Right click in the empty area of cell1 of the first row (to the right of the text in the cell) to open context menu.
- 1. Click 'Row' -> 'Insert Row at the Right of Cell';
- * Expected Result: New Row established at the right hand of cell1.
-</pre>
-<textarea id="editor1" name="editor1" rows="10" cols="80">
-<style>td{ border: 1px dotted;}</style>	
-<table width=200>
-	<tr>
-		<td>
-			cell1
-		</td>
-		<td>
-			cell2
-		</td>
-	</tr>
+<textarea id='input_1'>
+<table width="200">
+	<tbody>
+		<tr>
+			<td>
+				cell1^</td>
+			<td>
+				cell2</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+<textarea id='input_2'>
+<table width="200">
+	<tbody>
+		<tr>
+			<td>
+				cell1^</td>
+			<td>
+				cell2</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+<textarea id='input_3'>
+<table width="200">
+	<tbody>
+		<tr>
+			<td>
+				cell1[</td>
+			<td>
+				]cell2</td>
+		</tr>
+	</tbody>
+</table>
+</textarea>
+<textarea id='input_4'>
+<table width="200">
+	<tbody>
+		<tr>
+			<td>
+				cell1[</td>
+			<td>
+				]cell2</td>
+		</tr>
+	</tbody>
 </table>
 </textarea>
