Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Errors

/* Any copyright is dedicated to the Public Domain.
// There are shutdown issues for which multiple rejections are left uncaught.
// See bug 1018184 for resolving these issues.
const { PromiseTestUtils } = ChromeUtils.importESModule(
);
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);
Services.scriptloader.loadSubScript(
this
);
// On debug test machine, it takes about 50s to run the test.
requestLongerTimeout(4);
/**
* Check that different-site iframes can be expanded in the Omniscient Browser
* Toolbox. The test is supposed to run successfully with or without fission.
* Pass --enable-fission to ./mach test to enable fission when running this
* test locally.
*/
add_task(async function () {
await pushPref("devtools.browsertoolbox.scope", "everything");
const ToolboxTask = await initBrowserToolboxTask();
await ToolboxTask.importFunctions({
getNodeFront,
getNodeFrontInFrames,
selectNode,
// selectNodeInFrames depends on selectNode, getNodeFront, getNodeFrontInFrames.
selectNodeInFrames,
});
const tab = await addTab(
);
// Set a custom attribute on the tab's browser, in order to easily select it in the markup view
tab.linkedBrowser.setAttribute("test-tab", "true");
const testAttribute = await ToolboxTask.spawn(null, async () => {
/* global gToolbox */
const inspector = await gToolbox.selectTool("inspector");
const onSidebarSelect = inspector.sidebar.once("select");
inspector.sidebar.select("computedview");
await onSidebarSelect;
info("Select the test element nested in the remote iframe");
const nodeFront = await selectNodeInFrames(
['browser[remote="true"][test-tab]', "iframe", "#inside-iframe"],
inspector
);
return nodeFront.getAttribute("test-attribute");
});
is(
testAttribute,
"fission",
"Could successfully read attribute on a node inside a remote iframe"
);
await ToolboxTask.destroy();
});