diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /editor/libeditor/tests/test_bug646194.html | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | editor/libeditor/tests/test_bug646194.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/editor/libeditor/tests/test_bug646194.html b/editor/libeditor/tests/test_bug646194.html new file mode 100644 index 0000000000..5131e9cab0 --- /dev/null +++ b/editor/libeditor/tests/test_bug646194.html @@ -0,0 +1,36 @@ +<!doctype html> +<title>Mozilla Bug 646194</title> +<link rel=stylesheet href="/tests/SimpleTest/test.css"> +<script src="/tests/SimpleTest/SimpleTest.js"></script> +<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=646194" + target="_blank">Mozilla Bug 646194</a> +<iframe id="i" srcdoc="<div contenteditable=true id=t>test me now</div>"></iframe> +<script> +function runTest() { + var i = document.getElementById("i"); + i.focus(); + var win = i.contentWindow; + var doc = i.contentDocument; + var t = doc.getElementById("t"); + t.focus(); + // put the caret at the end + win.getSelection().collapse(t.firstChild, 11); + + // Simulate pression Option+Delete on Mac + // We do things this way because not every platform can invoke this + // command using the available key bindings. + SpecialPowers.doCommand(window, "cmd_wordPrevious"); + SpecialPowers.doCommand(window, "cmd_wordPrevious"); + SpecialPowers.doCommand(window, "cmd_deleteWordBackward"); + SpecialPowers.doCommand(window, "cmd_deleteWordBackward"); + + // If we reach here, we haven't crashed. Phew! + // But let's check the value too, now that we're here. + is(t.textContent, "me now", "The command has worked correctly"); + + SimpleTest.finish(); +} + +SimpleTest.waitForExplicitFinish(); +addLoadEvent(runTest); +</script> |