Index: _source/tests/core/test.html
===================================================================
--- _source/tests/core/test.html (revision 0)
+++ _source/tests/core/test.html (revision 0)
@@ -0,0 +1,55 @@
+
+
+
+ Test
+
+
+
+
+
+
+
+
Index: _source/core/test.js
===================================================================
--- _source/core/test.js (revision 3168)
+++ _source/core/test.js (working copy)
@@ -114,3 +114,72 @@
return html;
}
};
+
+/**
+ * All tests in this case share a fully interacted 'playground' editor instance.
+ */
+CKEDITOR.test.InteractiveEditorTestCase = function( template ) {
+ CKEDITOR.test.InteractiveEditorTestCase.superclass.constructor.call( this, template );
+ // The editor instance shared by all tests.
+ this.editor = null;
+};
+
+YAHOO.lang.extend( CKEDITOR.test.InteractiveEditorTestCase, YAHOO.tool.TestCase, {
+
+ /**
+ * Load the editor and wait for fully interactable, the editor is created by replacement mode.
+ * @param {CKEDITOR.config} config The config options for the shared editor instance.
+ * @param {Functoin} callback The callback continuation function.
+ */
+ waitForEditor :function ( callback, config )
+ {
+ if ( this.editor )
+ callback.call( this );
+ else
+ {
+ var editorName = this.editorName || 'test_editor';
+ CKEDITOR.on( 'instanceReady', function( evt )
+ {
+ if ( evt.editor.name == editorName )
+ {
+ window.setTimeout( CKEDITOR.tools.bind( function()
+ {
+
+ this.editor = evt.editor;
+ this.editor.focus();
+ this.resume( CKEDITOR.tools.bind( callback, this ) );
+
+ }, this ), 0 );
+ }
+ }, this );
+
+ var element = CKEDITOR.document.getBody().append(
+ CKEDITOR.dom.element.createFromHtml(
+ '') );
+ element.setValue( this.defaultEditorData );
+
+ CKEDITOR.replace( element.getAttribute( 'id' ), config );
+
+ // First load, async
+ this.wait();
+ }
+ },
+
+ setUp : function() {
+ if(this.editor)
+ {
+ this.editor.loadSnapshot( this.defaultEditorData );
+ this.editor.focus();
+ }
+ },
+
+ /**
+ * Clear up the editor data for each test.
+ */
+ tearDown : function() {
+ if( this.editor )
+ {
+ this.editor.loadSnapshot('');
+ }
+ }
+});
\ No newline at end of file