Bug 1602610 - Make `test_use_split_keypress_event_model_on_old_Office_Online_Servier.html` listen to `CheckKeyPressEventModel` event for avoiding intermittent failure r=smaug

It's a testcase for Office Online Server duplicated from `test_bug1514940.html`.
The original test listens to `CheckKeyPressEventModel` event which is fired
when the `keypress` event model is changed from the default mode.  Therefore,
this test also needs to listen to the event for avoiding intermittent failure
which is caused by running the tests before the mode change.

However, unfortunately, for keeping the performance of web apps which don't
need our mode changes, we can check the event only on debug build.  Therefore,
this patch makes the test run only on debug build.

Finally, this patch renames `test_bug154940.html` too because it tests
special behavior on specific web app and the new test name explains it like
the test for Office Online Server.

Differential Revision: https://phabricator.services.mozilla.com/D64919

--HG--
rename : dom/events/test/test_bug1514940.html => dom/events/test/test_use_split_keypress_event_model_on_old_Confluence.html
extra : moz-landing-system : lando
This commit is contained in:
Masayuki Nakano 2020-03-02 11:39:00 +00:00
Родитель 8ca8aa8311
Коммит fa274b5db3
3 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -149,8 +149,6 @@ support-files = bug1017086_inner.html
[test_bug1264380.html]
[test_bug1327798.html]
skip-if = headless
[test_bug1514940.html]
skip-if = !debug
[test_click_on_reframed_generated_text.html]
[test_click_on_restyled_element.html]
[test_clickevent_on_input.html]
@ -196,7 +194,10 @@ support-files =
skip-if = headless # Bug 1405869
[test_text_event_in_content.html]
[test_use_conflated_keypress_event_model_on_newer_Office_Online_Server.html]
[test_use_split_keypress_event_model_on_old_Confluence.html]
skip-if = !debug # The mode change event is available only on debug build
[test_use_split_keypress_event_model_on_old_Office_Online_Server.html]
skip-if = !debug # The mode change event is available only on debug build
[test_wheel_default_action.html]
skip-if = os == 'linux'
[test_bug687787.html]

Просмотреть файл

@ -45,9 +45,7 @@ SimpleTest.waitForFocus(async function doTests() {
let iframe = document.getElementById("iframe");
let waitForCheckKeyPressEventModelEvent = new Promise(resolve => {
SpecialPowers.addSystemEventListener(iframe.contentDocument, "CheckKeyPressEventModel", () => {
resolve();
}, false);
SpecialPowers.addSystemEventListener(iframe.contentDocument, "CheckKeyPressEventModel", resolve, {once: true});
});
iframe.contentDocument.body.setAttribute("contenteditable", "true");
await waitForCheckKeyPressEventModelEvent;

Просмотреть файл

@ -18,6 +18,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1545410
<iframe id="iframe" srcdoc='<html><body><div id="WACViewPanel_EditingElement" spellcheck="false" class="FireFox usehover WACEditing EditMode EditingSurfaceBody" style="overflow: visible; visibility: visible;" contenteditable="true"></div></body></html>'></iframe>
<script>
SimpleTest.waitForExplicitFinish();
let waitForCheckKeyPressEventModelEvent = new Promise(resolve => {
SpecialPowers.addSystemEventListener(document.querySelector("iframe").contentDocument, "CheckKeyPressEventModel", resolve, {once: true});
});
SimpleTest.waitForFocus(async function doTests() {
await SpecialPowers.pushPrefEnv({
set: [
@ -26,6 +29,7 @@ SimpleTest.waitForFocus(async function doTests() {
});
let iframe = document.getElementById("iframe");
await waitForCheckKeyPressEventModelEvent;
iframe.contentDocument.body.firstChild.focus();
let keypressEvent;
iframe.contentDocument.body.addEventListener("keypress", aEvent => keypressEvent = aEvent, {once: true});