editor/libeditor/html/tests/test_bug629845.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=629845
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 629845</title>
michael@0 8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
michael@0 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 11 </head>
michael@0 12 <body>
michael@0 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=629845">Mozilla Bug 629845</a>
michael@0 14 <p id="display"></p>
michael@0 15
michael@0 16 <script>
michael@0 17 function initFrame(frame)
michael@0 18 {
michael@0 19 frame.contentWindow.document.designMode="on";
michael@0 20 frame.contentWindow.document.writeln("<body></body>");
michael@0 21
michael@0 22 document.getElementsByTagName('button')[0].click();
michael@0 23 }
michael@0 24
michael@0 25 function command(aName)
michael@0 26 {
michael@0 27 var frame = document.getElementsByTagName('iframe')[0];
michael@0 28
michael@0 29 is(frame.contentDocument.designMode, "on", "design mode should be on!");
michael@0 30 var caught = false;
michael@0 31 try {
michael@0 32 frame.contentDocument.execCommand(aName, false, null);
michael@0 33 } catch (e) {
michael@0 34 ok(false, "exception " + e + " was thrown");
michael@0 35 caught = true;
michael@0 36 }
michael@0 37
michael@0 38 ok(!caught, "No exception should have been thrown.");
michael@0 39
michael@0 40 // Stop the document load before finishing, just to be clean.
michael@0 41 document.getElementsByTagName('iframe')[0].contentWindow.document.close();
michael@0 42 SimpleTest.finish();
michael@0 43 }
michael@0 44 </script>
michael@0 45
michael@0 46 <div id="content">
michael@0 47 <button type="button" onclick="command('bold');">Bold</button>
michael@0 48 <iframe onload="initFrame(this);"></iframe>
michael@0 49 </div>
michael@0 50 <pre id="test">
michael@0 51 <script type="application/javascript">
michael@0 52
michael@0 53 /** Test for Bug 629845 **/
michael@0 54
michael@0 55 SimpleTest.waitForExplicitFinish();
michael@0 56
michael@0 57 </script>
michael@0 58 </pre>
michael@0 59 </body>
michael@0 60 </html>

mercurial