editor/libeditor/text/tests/test_bug483651.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/editor/libeditor/text/tests/test_bug483651.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<!-- This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +   - License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     1.8 +<html>
     1.9 +<!--
    1.10 +https://bugzilla.mozilla.org/show_bug.cgi?id=483651
    1.11 +-->
    1.12 +
    1.13 +<head>
    1.14 +  <title>Test for Bug 483651</title>
    1.15 +  <script type="application/javascript"
    1.16 +          src="chrome://mochikit/content/MochiKit/packed.js"></script>
    1.17 +  <script type="application/javascript"
    1.18 +          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
    1.19 +  <script type="application/javascript"
    1.20 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.21 +  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
    1.22 +</head>
    1.23 +
    1.24 +<body onload="doTest();">
    1.25 +  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=483651">Mozilla Bug 483651</a>
    1.26 +  <p id="display"></p>
    1.27 +  <div id="content" style="display: none">
    1.28 +  </div>
    1.29 +
    1.30 +  <pre id="test">
    1.31 +    <script type="application/javascript">
    1.32 +
    1.33 +      /** Test for Bug 483651 **/
    1.34 +
    1.35 +      SimpleTest.waitForExplicitFinish();
    1.36 +
    1.37 +      function doTest() {
    1.38 +        var t1 = $("t1");
    1.39 +        var editor = null;
    1.40 +
    1.41 +        if (t1 instanceof Components.interfaces.nsIDOMNSEditableElement)
    1.42 +          editor = t1.editor;
    1.43 +
    1.44 +        ok(editor, "able to get editor for the element");
    1.45 +        t1.focus();
    1.46 +        synthesizeKey("A", {});
    1.47 +        synthesizeKey("VK_BACK_SPACE", {});
    1.48 +
    1.49 +        try {
    1.50 +          // Was the trailing br removed?
    1.51 +          is(editor.documentIsEmpty, true, "trailing <br> correctly removed");
    1.52 +        } catch (e) {
    1.53 +          ok(false, "test failed with error "+e);
    1.54 +        }
    1.55 +        SimpleTest.finish();
    1.56 +      }
    1.57 +   </script>
    1.58 +  </pre>
    1.59 +
    1.60 +  <textarea id="t1" rows="2" columns="80"></textarea>
    1.61 +</body>
    1.62 +</html>

mercurial