Bug 1892514 - part 5-3: Enable the assertions in IMEContentObserver::FlatTextCache in some automated tests r=smaug

This patch enables the assertions when running:
* The `nsITextInputProcessor` tests
* The IME composition tests under `widget/`
* Under `editor/libeditor/tests`
* Under `editor/libeditor/crashtests`
* Under testing/web-platform/tests/editing`
* Under testing/web-platform/tests/input-events`

Differential Revision: https://phabricator.services.mozilla.com/D211835
This commit is contained in:
Masayuki Nakano 2024-07-03 08:04:28 +00:00
parent aa96b488c9
commit a9a18ed278
11 changed files with 27 additions and 2 deletions

View File

@ -10,6 +10,10 @@
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(async () => {
await SpecialPowers.pushPrefEnv({
set: [["test.ime_content_observer.assert_invalid_cache", true]],
});
const textarea = document.createElement("textarea");
document.body.appendChild(textarea);
textarea.focus();

View File

@ -4966,6 +4966,10 @@ async function runTextNotificationChangesDuringNoFrame() {
async function runTests()
{
await SpecialPowers.pushPrefEnv({
set: [["test.ime_content_observer.assert_invalid_cache", true]],
});
textareaInFrame = iframe.contentDocument.getElementById("textarea");
runBeginInputTransactionMethodTests();
runReleaseTests();

View File

@ -9,6 +9,10 @@
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(async () => {
await SpecialPowers.pushPrefEnv({
set: [["test.ime_content_observer.assert_invalid_cache", true]],
});
const editingHost = document.querySelector("div[contenteditable]");
const TIP = SpecialPowers.Cc["@mozilla.org/text-input-processor;1"].createInstance(
SpecialPowers.Ci.nsITextInputProcessor

View File

@ -12,7 +12,10 @@
<div contenteditable id="editor"><p><br></p></div>
<script>
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function doTests() {
SimpleTest.waitForFocus(async function doTests() {
await SpecialPowers.pushPrefEnv({
set: [["test.ime_content_observer.assert_invalid_cache", true]],
});
for (let editorId of ["input", "textarea", "editor"]) {
let editor = document.getElementById(editorId);
editor.focus();

View File

@ -1,3 +1,5 @@
defaults pref(test.ime_content_observer.assert_invalid_cache,true)
load 336081-1.xhtml
load 403965-1.xhtml
load 428489-1.html

View File

@ -1,4 +1,5 @@
[DEFAULT]
prefs = ["test.ime_content_observer.assert_invalid_cache=true"]
skip-if = ["os == 'android'"]
["browser_bug527935.js"]

View File

@ -1,4 +1,5 @@
[DEFAULT]
prefs = ["test.ime_content_observer.assert_invalid_cache=true"]
skip-if = ["os == 'android'"]
["test_bug489202.xhtml"]

View File

@ -1,6 +1,7 @@
[DEFAULT]
prefs = [
"apz.zoom-to-focused-input.enabled=false",
"test.ime_content_observer.assert_invalid_cache=true",
"ui.dragThresholdX=4", # Bug 1873142
"ui.dragThresholdY=4", # Bug 1873142
]

View File

@ -0,0 +1 @@
prefs: [test.ime_content_observer.assert_invalid_cache:true]

View File

@ -1 +1,2 @@
prefs: [test.ime_content_observer.assert_invalid_cache:true]
leak-threshold: [default:51200]

View File

@ -10870,7 +10870,10 @@ async function runInputModeTest()
async function runTest()
{
await SpecialPowers.pushPrefEnv({
set: [["dom.events.textevent.enabled", true]],
set: [
["dom.events.textevent.enabled", true],
["test.ime_content_observer.assert_invalid_cache", true],
],
});
window.addEventListener("unload", window.arguments[0].SimpleTest.finish, {once: true, capture: true});