[iOS] ASSERTION FAILURE: !isMissingPostLayoutData in WebKit::EditorState::postLayoutD...
[WebKit-https.git] / LayoutTests / editing / deleting / ios / backspace-last-character.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../../../resources/ui-helper.js"></script>
6 </head>
7 <body>
8 <div id="test-container">
9     <textarea id="input"></textarea>
10     <textarea id="output" readonly></textarea>
11 </div>
12 <script>
13 window.jsTestIsAsync = true;
14
15 let input = document.getElementById("input");
16
17 function appendANewline()
18 {
19     let outputElement = document.getElementById("output");
20     outputElement.value = outputElement.value + "\n";
21 }
22
23 async function runTest()
24 {
25     if (window.testRunner)
26         await UIHelper.setHardwareKeyboardAttached(false);
27
28     await UIHelper.callFunctionAndWaitForEvent(() => window.testRunner && UIHelper.activateElement(input), input, "focus");
29
30     await UIHelper.callFunctionAndWaitForEvent(() => window.testRunner && UIHelper.keyDown("w"), input, "input");
31     shouldBeEqualToString('document.getElementById("input").value', "w");
32
33     await UIHelper.callFunctionAndWaitForEvent(() => window.testRunner && UIHelper.keyDown("\b"), input, "input");
34     shouldBeEqualToString('document.getElementById("input").value', "");
35
36     document.body.removeChild(document.getElementById("test-container"));
37     finishJSTest();
38 }
39
40 description("This tests using the software keyboard and pressing 'w' then <kbd>backspace</kbd> deletes the 'w' and does not cause an assertion failure in a debug build.")
41 input.addEventListener("keydown", appendANewline);
42
43 runTest();
44 </script>
45 </body>
46 </html>