Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=590554
5 -->
7 <head>
8 <title>Test for Bug 590554</title>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
12 </head>
14 <body>
16 <script type="application/javascript">
18 /** Test for Bug 590554 **/
20 SimpleTest.waitForExplicitFinish();
22 SimpleTest.waitForFocus(function() {
23 var t = document.querySelector("textarea");
24 t.focus();
25 synthesizeKey("VK_RETURN", {});
26 is(t.value, "\n", "Pressing enter should work the first time");
27 synthesizeKey("VK_RETURN", {});
28 is(t.value, "\n", "Pressing enter should not work the second time");
29 SimpleTest.finish();
30 });
32 </script>
34 <textarea maxlength="1"></textarea>
35 </body>
36 </html>