diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /widget/tests/test_assign_event_data.html | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/tests/test_assign_event_data.html')
-rw-r--r-- | widget/tests/test_assign_event_data.html | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/widget/tests/test_assign_event_data.html b/widget/tests/test_assign_event_data.html index 1da9bb535f..26d214edce 100644 --- a/widget/tests/test_assign_event_data.html +++ b/widget/tests/test_assign_event_data.html @@ -59,6 +59,7 @@ <body> <div id="display"> <input id="input-text"> + <div contenteditable id="contenteditable"><br></div> <button id="button">button</button> <a id="a" href="about:blank">hyper link</a> <span id="pointer-target">span</span> @@ -352,6 +353,44 @@ const kTests = [ }, todoMismatch: [ ], }, + { description: "InternalLegacyTextEvent (input at key input)", + targetID: "input-text", eventType: "textInput", + dispatchEvent() { + const input = document.getElementById(this.targetID); + input.value = ""; + input.focus(); + synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, kIsWin ? WIN_VK_B : MAC_VK_ANSI_B, + { shiftKey: true }, "B", "B"); + observeKeyUpOnContent(KeyboardEvent.DOM_VK_B, runNextTest); + return true; + }, + canRun() { + return (kIsMac || kIsWin); + }, + todoMismatch: [], + }, + { description: "InternalLegacyTextEvent (paste)", + targetID: "contenteditable", eventType: "textInput", + async dispatchEvent() { + const editingHost = document.getElementById(this.targetID); + editingHost.innerHTML = "abc"; + editingHost.focus(); + getSelection().selectAllChildren(editingHost); + synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, kIsWin ? WIN_VK_C : MAC_VK_ANSI_C, + { accelKey: true }, "", "c"); + const waitForInput = new Promise(resolve => { + editingHost.addEventListener("input", resolve, {once: true}); + }); + // In this case, TextEvent.data is stored with a dataTransfer. + synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, kIsWin ? WIN_VK_V : MAC_VK_ANSI_V, + { accelKey: true }, "", "v"); + await waitForInput; + }, + canRun() { + return (kIsMac || kIsWin); + }, + todoMismatch: [], + }, { description: "WidgetMouseScrollEvent (DOMMouseScroll, vertical)", targetID: "input-text", eventType: "DOMMouseScroll", dispatchEvent() { @@ -615,7 +654,7 @@ const kTests = [ }, ]; -function doTest(aTest) { +async function doTest(aTest) { if (!aTest.canRun()) { SimpleTest.executeSoon(runNextTest); return; @@ -650,7 +689,7 @@ function doTest(aTest) { runNextTest(); } }; - var testWillCallRunNextTest = aTest.dispatchEvent(); + var testWillCallRunNextTest = await aTest.dispatchEvent(); } var gIndex = -1; @@ -695,7 +734,8 @@ function init() { ["mousewheel.with_alt.action", 0], ["mousewheel.with_alt.action.override_x", -1], ["mousewheel.with_meta.action", 0], - ["mousewheel.with_meta.action.override_x", -1]]}, runNextTest); + ["mousewheel.with_meta.action.override_x", -1], + ["dom.events.textevent.enabled", true]]}, runNextTest); } function finish() { |