Bug 1614462: Part 2c - Remove content mozbrowser tests. r=mccr8,marionette-reviewers,whimboo
<iframe mozbrowser> is no longer supported in content processes. Differential Revision: https://phabricator.services.mozilla.com/D70744
This commit is contained in:
@@ -18,48 +18,6 @@ async function openTabInUserContext(uri, userContextId) {
|
||||
return { tab, browser };
|
||||
}
|
||||
|
||||
// Opens `uri' in a new <iframe mozbrowser> with the provided userContextId.
|
||||
// Returns the newly opened browser.
|
||||
async function addBrowserFrameInUserContext(uri, userContextId) {
|
||||
// Create a browser frame with the user context and uri
|
||||
const browser = document.createElementNS(
|
||||
"http://www.w3.org/1999/xhtml",
|
||||
"iframe"
|
||||
);
|
||||
browser.setAttribute("remote", "true");
|
||||
browser.setAttribute("usercontextid", userContextId);
|
||||
browser.setAttribute("mozbrowser", "true");
|
||||
// `noisolation = true` means `OA.mInIsolatedMozBrowser = false` which matches
|
||||
// the default for a XUL browser. It is indepedent from user contexts.
|
||||
browser.setAttribute("noisolation", "true");
|
||||
browser.setAttribute("src", uri);
|
||||
gBrowser.tabpanels.appendChild(browser);
|
||||
|
||||
// Create a XUL browser-like API expected by test helpers
|
||||
Object.defineProperty(browser, "messageManager", {
|
||||
get() {
|
||||
return browser.frameLoader.messageManager;
|
||||
},
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
});
|
||||
|
||||
await browserFrameLoaded(browser);
|
||||
|
||||
return { browser };
|
||||
}
|
||||
|
||||
function browserFrameLoaded(browser) {
|
||||
let event = "BrowserTestUtils:ContentEvent:load";
|
||||
return BrowserTestUtils.waitForEvent(browser, event);
|
||||
}
|
||||
|
||||
function removeBrowserFrame({ browser }) {
|
||||
browser.remove();
|
||||
// Clean up Browser API parent-side data
|
||||
delete window._browserElementParents;
|
||||
}
|
||||
|
||||
async function runTestForReceiver(receiver) {
|
||||
let channelName = "contextualidentity-broadcastchannel";
|
||||
|
||||
@@ -123,13 +81,3 @@ add_task(async function test() {
|
||||
await runTestForReceiver(receiver);
|
||||
gBrowser.removeTab(receiver.tab);
|
||||
});
|
||||
|
||||
add_task(async function test() {
|
||||
info("Checking broadcast channel with <iframe mozbrowser> receiver");
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["dom.mozBrowserFramesEnabled", true]],
|
||||
});
|
||||
let receiver = await addBrowserFrameInUserContext(URI, 2);
|
||||
await runTestForReceiver(receiver);
|
||||
removeBrowserFrame(receiver);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user