editor/libeditor/text/tests/test_bug590554.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/editor/libeditor/text/tests/test_bug590554.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=590554
     1.8 +-->
     1.9 +
    1.10 +<head>
    1.11 +  <title>Test for Bug 590554</title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>  
    1.15 +</head>
    1.16 +
    1.17 +<body>
    1.18 +
    1.19 +  <script type="application/javascript">
    1.20 +
    1.21 +    /** Test for Bug 590554 **/
    1.22 +
    1.23 +    SimpleTest.waitForExplicitFinish();
    1.24 +
    1.25 +    SimpleTest.waitForFocus(function() {
    1.26 +      var t = document.querySelector("textarea");
    1.27 +      t.focus();
    1.28 +      synthesizeKey("VK_RETURN", {});
    1.29 +      is(t.value, "\n", "Pressing enter should work the first time");
    1.30 +      synthesizeKey("VK_RETURN", {});
    1.31 +      is(t.value, "\n", "Pressing enter should not work the second time");
    1.32 +      SimpleTest.finish();
    1.33 +    });
    1.34 +
    1.35 +  </script>
    1.36 +
    1.37 +  <textarea maxlength="1"></textarea>
    1.38 +</body>
    1.39 +</html>

mercurial