Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / editor / libeditor / tests / test_bug358033.html
blobdb2b00400ec67dc4b10ea22f286101b272e21621
1 <!DOCTYPE html>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=358033
5 -->
6 <head>
7 <title>Test for Bug 358033</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=358033">Mozilla Bug 358033</a>
14 <p id="display"></p>
15 <div id="content">
16 <input type="text" id="input1">
17 </div>
18 <pre id="test">
19 <script>
20 SimpleTest.waitForExplicitFinish();
21 SimpleTest.waitForFocus(function() {
22 let input = document.getElementById("input1");
24 input.value = "ABC DEF";
25 input.focus();
26 input.setSelectionRange(4, 7, "backward");
27 synthesizeKey("KEY_Backspace");
28 is(input.value, "ABC ", "KEY_Backspace should remove selected string");
29 synthesizeKey("Z", { accelKey: true });
30 is(input.value, "ABC DEF", "Undo should restore string");
31 synthesizeKey("KEY_ArrowLeft", { shiftKey: true });
32 synthesizeKey("KEY_ArrowLeft", { shiftKey: true });
33 synthesizeKey("KEY_Backspace");
35 is(input.value, "AB", "anchor node and focus node should be kept order after undo");
37 SimpleTest.finish();
38 });
39 </script>
40 </body>
41 </html>