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-28 17:20:33 +00:00
parent 8b553ecfcf
commit 19d0babe24
6 changed files with 27 additions and 36 deletions

View File

@ -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: [

View File

@ -1004,9 +1004,7 @@ struct MOZ_STACK_CLASS BrowserParent::AutoUseNewTab final {
aNewTab->mCreatingWindow = true;
}
~AutoUseNewTab() {
mNewTab->mCreatingWindow = false;
}
~AutoUseNewTab() { mNewTab->mCreatingWindow = false; }
private:
RefPtr<BrowserParent> mNewTab;

View File

@ -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" });

View File

@ -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

View File

@ -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="">

View File

@ -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