Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 9c37671

Browse files
Add console logging to try and diagnose editing/deleting/ios/backspace-last-character.html
https://bugs.webkit.org/show_bug.cgi?id=213201 <rdar://problem/64165890> Reviewed by Tim Horton. Break the test down into more steps (namely, separate waiting for events from synthesizing key events), and add a console log statement at each step. * editing/deleting/ios/backspace-last-character-expected.txt: * editing/deleting/ios/backspace-last-character.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@263052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 8cd01f5 commit 9c37671

File tree

3 files changed

+49
-5
lines changed

3 files changed

+49
-5
lines changed

LayoutTests/ChangeLog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2020-06-15 Wenson Hsieh <[email protected]>
2+
3+
Add console logging to try and diagnose editing/deleting/ios/backspace-last-character.html
4+
https://bugs.webkit.org/show_bug.cgi?id=213201
5+
<rdar://problem/64165890>
6+
7+
Reviewed by Tim Horton.
8+
9+
Break the test down into more steps (namely, separate waiting for events from synthesizing key events), and add
10+
a console log statement at each step.
11+
12+
* editing/deleting/ios/backspace-last-character-expected.txt:
13+
* editing/deleting/ios/backspace-last-character.html:
14+
115
2020-06-15 Diego Pino Garcia <[email protected]>
216

317
[WPE] Unreviewed test gardening. Update expected results of flaky image failures.

LayoutTests/editing/deleting/ios/backspace-last-character-expected.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
CONSOLE MESSAGE: Activating element and waiting for input session.
2+
CONSOLE MESSAGE: Waiting for element focus.
3+
CONSOLE MESSAGE: Typing 'w'.
4+
CONSOLE MESSAGE: Waiting for first input event.
5+
CONSOLE MESSAGE: Hitting backspace.
6+
CONSOLE MESSAGE: Waiting for second input event.
7+
CONSOLE MESSAGE: Test complete.
18
This tests using the software keyboard and pressing 'w' then backspace deletes the 'w' and does not cause an assertion failure in a debug build.
29

310
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
411

512

13+
PASS inputDidFocus became true
14+
PASS inputEventCount became 1
615
PASS document.getElementById("input").value is "w"
16+
PASS inputEventCount became 2
717
PASS document.getElementById("input").value is ""
818
PASS successfullyParsed is true
919

LayoutTests/editing/deleting/ios/backspace-last-character.html

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
window.jsTestIsAsync = true;
1414

1515
let input = document.getElementById("input");
16+
let inputDidFocus = false;
17+
let inputEventCount = 0;
1618

1719
function appendANewline()
1820
{
@@ -22,22 +24,40 @@
2224

2325
async function runTest()
2426
{
25-
if (window.testRunner)
27+
input.addEventListener("focus", () => inputDidFocus = true);
28+
input.addEventListener("input", () => ++inputEventCount);
29+
30+
if (window.testRunner) {
2631
await UIHelper.setHardwareKeyboardAttached(false);
32+
console.log("Activating element and waiting for input session.");
33+
await UIHelper.activateElementAndWaitForInputSession(input);
34+
}
35+
36+
console.log("Waiting for element focus.");
37+
await new Promise(resolve => shouldBecomeEqual("inputDidFocus", "true", resolve));
2738

28-
await UIHelper.callFunctionAndWaitForEvent(() => window.testRunner && UIHelper.activateElement(input), input, "focus");
39+
console.log("Typing 'w'.");
40+
if (window.testRunner)
41+
await UIHelper.keyDown("w");
2942

30-
await UIHelper.callFunctionAndWaitForEvent(() => window.testRunner && UIHelper.keyDown("w"), input, "input");
43+
console.log("Waiting for first input event.");
44+
await new Promise(resolve => shouldBecomeEqual("inputEventCount", "1", resolve));
3145
shouldBeEqualToString('document.getElementById("input").value', "w");
3246

33-
await UIHelper.callFunctionAndWaitForEvent(() => window.testRunner && UIHelper.keyDown("\b"), input, "input");
47+
console.log("Hitting backspace.");
48+
if (window.testRunner)
49+
await UIHelper.keyDown("\b");
50+
51+
console.log("Waiting for second input event.");
52+
await new Promise(resolve => shouldBecomeEqual("inputEventCount", "2", resolve));
3453
shouldBeEqualToString('document.getElementById("input").value', "");
3554

55+
console.log("Test complete.");
3656
document.body.removeChild(document.getElementById("test-container"));
3757
finishJSTest();
3858
}
3959

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.")
60+
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.");
4161
input.addEventListener("keydown", appendANewline);
4262

4363
runTest();

0 commit comments

Comments
 (0)