Ticket #3028: test-config-startupFocus.patch

File test-config-startupFocus.patch, 1.7 KB (added by Garry Yao, 15 years ago)

Functional test case

  • _source/tests/core/config.html

     
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2<html xmlns="http://www.w3.org/1999/xhtml">
     3<head>
     4        <title>Config</title>
     5        <link rel="stylesheet" type="text/css" href="../test.css" />
     6        <script type="text/javascript" src="../../../ckeditor_source.js"></script>
     7        <script type="text/javascript" src="../test.js"></script>
     8        <script type="text/javascript">
     9        //<![CDATA[
     10// Local references.
     11var assert = CKEDITOR.test.assert;
     12
     13CKEDITOR.test.addTestCase(
     14{
     15        /**
     16         * Test <b>startupFocus:true</b> with <b>startupMode: wysiwyg </b> 
     17         */
     18    test_config1 : function()
     19    {
     20            var editor = CKEDITOR.replace( 'editor1' , {
     21                        startupFocus: true,
     22                        startupMode : 'wysiwyg'
     23                });
     24               
     25            editor.on( 'instanceReady', function()
     26            {
     27                    this.resume( function()
     28                    {
     29                            assert.isTrue( editor.focusManager.hasFocus );
     30                    } );
     31            }, this );
     32
     33            this.wait();
     34    },
     35       
     36       
     37        /**
     38         * Test <b>startupFocus:true</b> with <b>startupMode: source </b>.
     39         */
     40    test_config2 : function()
     41    {
     42            var editor = CKEDITOR.replace( 'editor2' , {
     43                        startupFocus : true,
     44                        startupMode : 'source'
     45                });
     46               
     47                assert.isTrue( editor.focusManager.hasFocus );
     48    },
     49
     50    name :document.title
     51} );
     52
     53        //]]>
     54        </script>
     55</head>
     56<body>
     57        <textarea id="editor1" name="editor1"></textarea>
     58        <textarea id="editor2" name="editor2"></textarea>
     59</body>
     60</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy