Bug 1714594, fix test_reftests_with_caret.html to use SpecialPowers.spawn to adjust the parent frame, and re-enable in xorigin mode, r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D117380
This commit is contained in:
Neil Deakin 2021-06-10 18:44:17 +00:00
Родитель f5283149a6
Коммит 1dc3099144
2 изменённых файлов: 10 добавлений и 8 удалений

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

@ -169,7 +169,6 @@ support-files = preserve3d_sorting_hit_testing_iframe.html
support-files = preserve3d_sorting_hit_testing2_iframe.html
[test_reftests_with_caret.html]
skip-if = toolkit == 'android' || tsan # android: Bug 1355842. tsan: Bug 1612707
fail-if = xorigin
support-files =
bug106855-1.html
bug106855-2.html

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

@ -97,9 +97,11 @@ function refTest(test,ref) {
};
var caretBlinkTime = null;
function endTest() {
var parentDoc = window.parent.document;
parentDoc.styleSheets[parentDoc.styleSheets.length-1].deleteRule(0);
async function endTest() {
await SpecialPowers.spawn(window.parent, [], () => {
content.document.styleSheets[content.document.styleSheets.length-1].deleteRule(0);
});
// finish(), yet let the test actually end first, to be safe.
SimpleTest.executeSoon(SimpleTest.finish);
}
@ -428,12 +430,13 @@ function nextTest() {
endTest();
}
}
function runTests() {
async function runTests() {
try {
if (window.parent) {
var parentDoc = window.parent.document;
extraCSSRule = parentDoc.styleSheets[parentDoc.styleSheets.length-1]
.insertRule("iframe#testframe{width:600px;height:400px}",0);
await SpecialPowers.spawn(window.parent, [], () => {
content.document.styleSheets[content.document.styleSheets.length-1]
.insertRule("iframe#testframe{width:600px;height:400px}",0);
});
}
try {
caretBlinkTime = SpecialPowers.getIntPref("ui.caretBlinkTime");