Bug 1589102 - Part 2: Fix tests that were broken as a result of about:srcdoc going via DocumentChannel, r=mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D85080
This commit is contained in:
Anny Gakhokidze 2020-08-05 16:44:04 +00:00
Родитель e903c66d34
Коммит 05b0ef78c2
5 изменённых файлов: 26 добавлений и 33 удалений

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

@ -15,12 +15,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1545410
<p id="display"></p>
<pre id="test"></pre>
<input id="input">
<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>
<iframe id="iframe" onload="srcdocLoaded()" srcdoc='<html><body><div id="WACViewPanel_EditingElement" spellcheck="false" class="FireFox usehover WACEditing EditMode EditingSurfaceBody" style="overflow: visible; visibility: visible;"></div></body></html>'></iframe>
<script>
SimpleTest.waitForExplicitFinish();
let waitForCheckKeyPressEventModelEvent = new Promise(resolve => {
SpecialPowers.addSystemEventListener(document.querySelector("iframe").contentDocument, "CheckKeyPressEventModel", resolve, {once: true});
});
let waitForCheckKeyPressEventModelEvent;
function srcdocLoaded() {
waitForCheckKeyPressEventModelEvent = new Promise(resolve => {
dump(document.querySelector("iframe").contentDocument.location + "\n");
var doc = document.querySelector("iframe").contentDocument;
SpecialPowers.addSystemEventListener(doc, "CheckKeyPressEventModel", resolve, {once: true});
doc.getElementById("WACViewPanel_EditingElement").contentEditable = "true";
});
}
SimpleTest.waitForFocus(async function doTests() {
await SpecialPowers.pushPrefEnv({
set: [

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

@ -3,13 +3,13 @@
<head>
<script src="mediaStreamPlayback.js"></script>
</head>
<iframe id="iframe" srcdoc="<script>
window.enumerateDevices = () =>
navigator.mediaDevices.enumerateDevices();
</script>"
width="100%" height="50%" frameborder="1">
</iframe>
<body>
<iframe id="iframe" srcdoc="<script>
window.enumerateDevices = () =>
navigator.mediaDevices.enumerateDevices();
</script>"
width="100%" height="50%" frameborder="1">
</iframe>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "Suspend enumerateDevices code ", bug: "1479840" });

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

@ -5,7 +5,7 @@
</head>
<body>
<pre id="test">
<iframe id="iframe" srcdoc="
<iframe id="iframe" onload="iframeLoaded()" srcdoc="
<script type='application/javascript'>
document.gUM = (constraints, success, failure) =>
navigator.mediaDevices.getUserMedia(constraints).then(success, failure);
@ -13,13 +13,21 @@
</iframe>
<script type="application/javascript">
"use strict";
let iframeLoadedPromise = {};
iframeLoadedPromise.promise = new Promise(r => {
iframeLoadedPromise.resolve = r;
});;
function iframeLoaded() {
iframeLoadedPromise.resolve();
}
createHTML({
title: "getUserMedia MediaStreamTrack 'ended' event on navigating",
bug: "1208373",
});
runTest(() => {
runTest(async () => {
await iframeLoadedPromise.promise;
let iframe = document.getElementById("iframe");
let stream;
// We're passing callbacks into a method in the iframe here, because

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

@ -1,20 +0,0 @@
<html class="reftest-wait">
<script>
function eh1() {
a.selectionEnd = 1
}
function eh2() {
var d = c.contentDocument.createRange()
d.cloneRange().insertNode(b)
requestAnimationFrame(() => {
requestAnimationFrame(() => {
document.documentElement.className = "";
});
});
}
</script>
<textarea id="a" onselect="eh2()">
</textarea>
<video id="b" controls=""></video>
<iframe id="c" srcdoc=""></iframe>
<details ontoggle="eh1()" open="">

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

@ -302,7 +302,6 @@ load 1514086.html
load 1533783.html
load 1533891.html
pref(gfx.omta.background-color,true) load 1533968.html
load 1541126.html
load 1545177.html
skip-if(geckoview&&webrender) skip-if(Android) load 1546255.html # Bug 1563020 for GV+WR & Bug 1553971
pref(layout.css.resizeobserver.enabled,true) load 1552911.html