test_bug590554.html (880B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=590554 5 --> 6 7 <head> 8 <title>Test for Bug 590554</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 <script src="/tests/SimpleTest/EventUtils.js"></script> 12 </head> 13 14 <body> 15 16 <script type="application/javascript"> 17 18 /** Test for Bug 590554 */ 19 20 SimpleTest.waitForExplicitFinish(); 21 22 SimpleTest.waitForFocus(function() { 23 var t = document.querySelector("textarea"); 24 t.focus(); 25 synthesizeKey("KEY_Enter"); 26 is(t.value, "\n", "Pressing enter should work the first time"); 27 synthesizeKey("KEY_Enter"); 28 is(t.value, "\n", "Pressing enter should not work the second time"); 29 SimpleTest.finish(); 30 }); 31 32 </script> 33 34 <textarea maxlength="1"></textarea> 35 </body> 36 </html>