editor/libeditor/html/tests/test_bug629845.html

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

mercurial