Bug 1812493 - Make the test wait for "load" of iframe if it's not yet ended r=m_kato

Differential Revision: https://phabricator.services.mozilla.com/D170029
This commit is contained in:
Masayuki Nakano 2023-02-17 15:35:04 +00:00
Родитель b3bf09cc0d
Коммит 48306992dd
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -12,8 +12,15 @@
"use strict";
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(() => {
SimpleTest.waitForFocus(async () => {
const iframe = document.querySelector("iframe");
await new Promise(resolve => {
if (iframe.contentDocument?.readyState == "complete") {
resolve();
return;
}
iframe.addEventListener("load", resolve, {once: true});
});
function testInDiv() {
const inPlaintextMode = getEditor(window).flags & SpecialPowers.Ci.nsIEditor.eEditorPlaintextMask;