test_bug1328023.html (1572B)
1 <!DOCTYPE html> 2 <!-- 3 https://bugzilla.mozilla.org/show_bug.cgi?id=1328023 4 --> 5 <html> 6 <head> 7 <title>Test for Bug 1328023</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script 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=1328023">Mozilla Bug 1328023</a> 14 <p id="display"></p> 15 <div id="content" style="display: none;"> 16 17 </div> 18 19 <input type="text" id="input1"/> 20 <pre id="test"> 21 22 <script class="testbody" type="application/javascript"> 23 SimpleTest.waitForExplicitFinish(); 24 SimpleTest.waitForFocus(function() { 25 let elm = document.getElementById("input1"); 26 27 elm.focus(); 28 sendString("AB"); 29 is(elm.value, "AB", "AB is input.value now"); 30 31 synthesizeKey("KEY_Backspace"); 32 is(elm.value, "A", "A is input.value now"); 33 34 synthesizeKey("Z", { accelKey: true }); 35 is(elm.value, "AB", "AB is input.value now"); 36 37 sendString("C"); 38 is(elm.value, "ABC", "ABC is input.value now"); 39 40 synthesizeKey("KEY_Backspace"); 41 synthesizeKey("KEY_Backspace"); 42 synthesizeKey("KEY_Backspace"); 43 44 sendString("ABC"); 45 is(elm.value, "ABC", "ABC is input.value now"); 46 47 synthesizeKey("Z", { accelKey: true }); 48 is(elm.value, "", "'' is input.value now"); 49 50 synthesizeKey("Z", { accelKey: true, shiftKey: true }); 51 is(elm.value, "ABC", "ABC is input.value now"); 52 53 sendString("D"); 54 is(elm.value, "ABCD", "ABCD is input.value now"); 55 56 SimpleTest.finish(); 57 }); 58 </script> 59 </pre> 60 </body> 61 </html>