Files
sousa-gecko/devtools/client/framework/test/browser_toolbox_remoteness_change.js
T
Emilio Cobos Álvarez 3234ef9347 Bug 2021694 - Make other XUL frame attributes regular bool attrs. r=firefox-desktop-core-reviewers ,devtools-reviewers,tabbrowser-reviewers,layout-reviewers,geckoview-reviewers,whimboo,hiro,nchevobbe,sthompson,mossop ,devtools-reviewers,tabbrowser-reviewers,layout-reviewers,geckoview-reviewers,whimboo,hiro,nchevobbe,sthompson,mossop
- primary / nodefaultsrc / allowscriptstoclose / forcemessagemanager
   are already used as true or not present, so no behavior change.
 - remote can be a regular XUL attr, but needs some consumers to change.

While at it remove the unused mozframetype attr, just use type for both
XUL and privileged iframes.

Differential Revision: https://phabricator.services.mozilla.com/D286522
2026-03-10 23:08:29 +00:00

52 lines
1.5 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const URL_1 = "about:robots";
const URL_2 =
"data:text/html;charset=UTF-8," +
encodeURIComponent('<div id="remote-page">foo</div>');
// Testing navigation between processes
add_task(async function () {
info(`Testing navigation between processes`);
info("Open a tab on a URL supporting only running in parent process");
const tab = await addTab(URL_1);
is(
tab.linkedBrowser.currentURI.spec,
URL_1,
"We really are on the expected document"
);
is(
tab.linkedBrowser.getAttribute("remote"),
null,
"And running in parent process"
);
const toolbox = await openToolboxForTab(tab);
info("Navigate to a URL supporting remote process");
await navigateTo(URL_2);
ok(
tab.linkedBrowser.hasAttribute("remote"),
"Navigated to a data: URI and switching to remote"
);
info("Veryify we are inspecting the new document");
const console = await toolbox.selectTool("webconsole");
const { ui } = console.hud;
ui.wrapper.dispatchEvaluateExpression("document.location.href");
await waitUntil(() => ui.outputNode.querySelector(".result"));
const url = ui.outputNode.querySelector(".result");
ok(
url.textContent.includes(URL_2),
"The console inspects the second document"
);
const { client } = toolbox.target;
await toolbox.destroy();
ok(client._transportClosed, "The client is closed after closing the toolbox");
});