Index: /CKEditor/tests/tt/2885/1.html
===================================================================
--- /CKEditor/tests/tt/2885/1.html	(revision 4414)
+++ /CKEditor/tests/tt/2885/1.html	(revision 4414)
@@ -0,0 +1,210 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Ticket: #2885 - Plugin: Div 1</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+</head>
+<body>
+<textarea id="test_editor_input">
+	<div>[div</div>
+	<table>
+		<tbody>
+			<tr>
+				<td>cell</td>
+				<td>cell</td>
+			</tr>
+		</tbody>
+	</table>
+	<ul>
+		<li>item1</li>
+		<li>item2</li>
+	</ul>
+	<p>paragraph]</p>
+</textarea>
+
+<textarea id="test_create_div_output">
+<div>
+	<div>
+		div</div>
+</div>
+<table>
+	<tbody>
+		<tr>
+			<td>
+				<div>
+					<p>
+						cell</p>
+				</div>
+			</td>
+			<td>
+				<div>
+					<p>
+						cell</p>
+				</div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+<div>
+	<ul>
+		<li>
+			item1</li>
+		<li>
+			item2</li>
+	</ul>
+	<p>
+		paragraph</p>
+</div>
+</textarea>
+<textarea id="test_edit_div_output">
+<div class="my-div">
+	<div>
+		div</div>
+</div>
+<table>
+	<tbody>
+		<tr>
+			<td>
+				<div>
+					<p>
+						cell</p>
+				</div>
+			</td>
+			<td>
+				<div>
+					<p>
+						cell</p>
+				</div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+<div>
+	<ul>
+		<li>
+			item1</li>
+		<li>
+			item2</li>
+	</ul>
+	<p>
+		paragraph</p>
+</div>
+</textarea>
+<textarea id="test_remove_div_output">
+<div>
+	div</div>
+<table>
+	<tbody>
+		<tr>
+			<td>
+				<p>
+					cell</p>
+			</td>
+			<td>
+				<p>
+					cell</p>
+			</td>
+		</tr>
+	</tbody>
+</table>
+<ul>
+	<li>
+		item1</li>
+	<li>
+		item2</li>
+</ul>
+<p>
+	paragraph</p>
+</textarea>
+
+<script type="text/javascript">
+//<![CDATA[
+var ts, tc, assert = CKEDITOR.test.assert, test = CKEDITOR.test;
+function normalizeTextareaValue( id )
+{
+	return CKEDITOR.test.fixHtml( CKEDITOR.document.getById( id ).getValue(), false, false );
+}
+
+function normalizeValue( str )
+{
+	return CKEDITOR.test.fixHtml( str, false, false );
+}
+
+YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
+	{
+			editorName : 'test_editor_1',
+			name : document.title
+	} ) );
+
+ts.add( tc = new YAHOO.tool.TestCase(
+	{
+		test_div_plugin_create : function ()
+		{
+			var editor = ts.editor,
+				command = 'creatediv';
+			editor.focus();
+			editor.execCommand( command );
+			test.setHtmlWithSelection(
+				editor.document.getBody(),
+				normalizeTextareaValue( 'test_editor_input' ) );
+
+			// waiting for dialog to open.
+			this.wait( function()
+			{
+				 var dialog = editor._.storedDialogs[ command ];
+				dialog.fire( 'ok' );
+				dialog.hide();
+
+				 var result = editor.getData();
+				 assert.areEqual( normalizeTextareaValue( 'test_create_div_output' ),
+						 normalizeValue( result ), 'Edited div result doesn\'t match.' );
+
+			}, 3000 );
+		},
+
+		test_div_plugin_edit : function ()
+		{
+			var editor = ts.editor,
+				command = 'editdiv';
+			editor.focus();
+			editor.execCommand( command );
+
+			// waiting for dialog to open.
+			this.wait( function()
+			{
+				 var dialog = editor._.storedDialogs[ command ],
+					 styleField = dialog.getContentElement( 'info', 'elementStyle' ),
+					 classField = dialog.getContentElement( 'info', 'class' );
+
+				styleField.setValue( 'background-color:blue' );
+				classField.setValue( 'my-div' );
+				dialog.fire( 'ok' );
+				dialog.hide();
+
+				var result = editor.getData();
+				assert.areEqual( normalizeTextareaValue( 'test_edit_div_output' ),
+						 normalizeValue( result ), 'Created div result doesn\'t match.' );
+
+			}, 3000 );
+		},
+
+
+		test_div_plugin_remove : function ()
+		{
+			var editor = ts.editor,
+				command = 'removediv';
+			editor.execCommand( command );
+			var result = editor.getData();
+			assert.areEqual( normalizeTextareaValue( 'test_remove_div_output' ),
+					normalizeValue( result ), 'Div Removed result doesn\'t match.' );
+		},
+
+		name : document.title
+	} ) );
+
+//]]>
+</script>
+
+</body>
+</html>
Index: /CKEditor/tests/tt/2885/2.html
===================================================================
--- /CKEditor/tests/tt/2885/2.html	(revision 4414)
+++ /CKEditor/tests/tt/2885/2.html	(revision 4414)
@@ -0,0 +1,159 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Ticket: #2885 - Plugin: Div 2</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+</head>
+<body>
+<textarea id="test_editor_input">
+	<table>
+		<tbody>
+			<tr>
+				<td>[cell</td>
+				<td>cell</td>
+			</tr>
+		</tbody>
+	</table>
+	<p>paragraph]</p>
+</textarea>
+
+<textarea id="test_create_div_output">
+<div>
+	<table>
+		<tbody>
+			<tr>
+				<td>
+					cell</td>
+				<td>
+					cell</td>
+			</tr>
+		</tbody>
+	</table>
+	<p>
+		paragraph</p>
+</div>
+</textarea>
+<textarea id="test_edit_div_output"><div class="my-div">
+	<table>
+		<tbody>
+			<tr>
+				<td>
+					cell</td>
+				<td>
+					cell</td>
+			</tr>
+		</tbody>
+	</table>
+	<p>
+		paragraph</p>
+</div>
+</textarea>
+<textarea id="test_remove_div_output">
+<table>
+	<tbody>
+		<tr>
+			<td>
+				cell</td>
+			<td>
+				cell</td>
+		</tr>
+	</tbody>
+</table>
+<p>
+	paragraph</p>
+</textarea>
+<script type="text/javascript">
+//<![CDATA[
+var ts, tc, assert = CKEDITOR.test.assert, test = CKEDITOR.test;
+function normalizeTextareaValue( id )
+{
+	return CKEDITOR.test.fixHtml( CKEDITOR.document.getById( id ).getValue(), false, false );
+}
+
+function normalizeValue( str )
+{
+	return CKEDITOR.test.fixHtml( str, false, false );
+}
+
+YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
+	{
+			editorName : 'test_editor_1',
+			config :
+			{
+				div_wrapTable : true
+			},
+			name : document.title
+	} ) );
+
+ts.add( tc = new YAHOO.tool.TestCase(
+	{
+		test_div_plugin_create : function ()
+		{
+			var editor = ts.editor,
+				command = 'creatediv';
+			editor.focus();
+			editor.execCommand( command );
+			test.setHtmlWithSelection(
+				editor.document.getBody(),
+				normalizeTextareaValue( 'test_editor_input' ) );
+
+			// waiting for dialog to open.
+			this.wait( function()
+			{
+				 var dialog = editor._.storedDialogs[ command ];
+				dialog.fire( 'ok' );
+				dialog.hide();
+
+				 var result = editor.getData();
+				 assert.areEqual( normalizeTextareaValue( 'test_create_div_output' ),
+						 normalizeValue( result ), 'Edited div result doesn\'t match.' );
+
+			}, 3000 );
+		},
+
+		test_div_plugin_edit : function ()
+		{
+			var editor = ts.editor,
+				command = 'editdiv';
+			editor.focus();
+			editor.execCommand( command );
+
+			// waiting for dialog to open.
+			this.wait( function()
+			{
+				 var dialog = editor._.storedDialogs[ command ],
+					 styleField = dialog.getContentElement( 'info', 'elementStyle' ),
+					 classField = dialog.getContentElement( 'info', 'class' );
+
+				styleField.setValue( 'background-color:blue' );
+				classField.setValue( 'my-div' );
+				dialog.fire( 'ok' );
+				dialog.hide();
+
+				var result = editor.getData();
+				assert.areEqual( normalizeTextareaValue( 'test_edit_div_output' ),
+						 normalizeValue( result ), 'Created div result doesn\'t match.' );
+
+			}, 3000 );
+		},
+
+
+		test_div_plugin_remove : function ()
+		{
+			var editor = ts.editor,
+				command = 'removediv';
+			editor.execCommand( command );
+			var result = editor.getData();
+			assert.areEqual( normalizeTextareaValue( 'test_remove_div_output' ),
+					normalizeValue( result ), 'Div Removed result doesn\'t match.' );
+		},
+
+		name : document.title
+	} ) );
+
+//]]>
+</script>
+
+</body>
+</html>
